Run the SDK C# Example Project¶
The SDK_Example project provides examples showing how to use the Mech-DLK SDK to implement the required functions in the application.
Taking defect segmentation as an example, this section provides the required model and image dataset to lead the user to run the SDK project:
Open the example project
Double-click the file SDK_Example.sln in the path shown below to open it with Visual Studio 2019.
Referencing SDK
Right-click on Browse…, check the file mmind_dl_sdk_csharp.dll in the folder Mech-DLK-2.3.0 and click on OK.
. The reference manager window will pop up. Click onBuild solution
Click on
to generate the executable file. Check the path generated by the executable in the output section at the bottom of the interface.Hint
Please comment out line 73 in Form1.cs, if an error “CS1061: ‘PackInfer’ does not contain a definition for ‘setVisible’ and no accessible extension method ‘setVisible’ accepting a first argument of type ‘PackInfer’ could be found (are you missing a using directive or an assembly reference?)” is reported.
Start project
Click on Start to run the program.
Program interface after startup:
Load Image: Load the image to be inferred.
Load Model: Load a model in dlkpack format exported by Mech-DLK.
Infer: perform inference.
Execution result:
Attention
It takes a little longer to load the model for the first time. About 5 minutes. It is recommended to use multiple threads to call the corresponding interface.