Questions about

How To Use SDK (LabVIEW)

How To Use SDK (LabView Version)

1. Overview
  • This tutorial is intended to introduce you to the use of the SDK (LabView version). The SDK toolkit is designed to assist engineers in AI vision development. For software development, you need to download it from official website
    1. The trained model file trained at [workbench] (https://www.neurobot.co/modelDevelopmentTool2)
    2. SDK toolkit (LabView Version)
2.Environment setup

Only supports NVIDIA GPU, does not support AMD and other brands.

  • Supported graphics card types: Nvidia GPU (Support GPU whose compute capability is "6.1", "7.5", "8.6"). For details, see "Select Hardware" in the model download page of the workbench.
alt text
alt text
alt text
3. Quick start with SDK
  • Here is an example to help you quickly understand how to complete LabView software development using the SDK. This example uses LabView (Q3 2022 version) and the LabView Vision Development module (Q3 2022 version).
3.1 Decompress SDK
  • Decompress the downloaded SDK file to a secure directory, as shown below:
alt text
3.2 Add environment path
  • Now start to add system environment variables, open "This computer", right-click the blank position, then select "Properties", click "advanced system Settings", click "environment variables", the following interface appears. Then select "Path" and click "Edit".
alt text
  • Click "New", then click "Browse":
alt text
  • Select the bin folder under the SDK folder:
alt text
  • Move this environment variable up to the first one:
alt text
alt text

Click "OK" when the operation is complete.

3.3 Configuring the License File
  • Please put the License.txt file in the SDK folder (The location of the License.txt file is subject to the current document)
alt text
3.4 Modify and run the sample code
  • Double-click on the dllrun0525.vi file in the SDK folder, as follows:
alt text
  • Click the folder icon next to test image path to select a single test image:
alt text
alt text
alt text
  • Modifying the model name
alt text
  • Click the folder icon next to model path to select a folder to store the model file
alt text
alt text
alt text
  • Select device name (For CPU processing please select cpu; for GPU processing please select cuda)
alt text
  • Set detect threshold(Detection threshold. If the detection threshold is exceeded, it is regarded as the target object. detect threshold = -1 indicates the default value. The default detection threshold is 0.7)
alt text
  • Select color mode (For color Image (RGB), Please select color; For grayscale images, select gray)
alt text
  • Click the (run) button in the upper left corner to run the program.
alt text
  • The results are as follows:
alt text
  • If an error occurs in the program, look at these four places to analyze the cause of the error:is img,is loaded,load() return and predict() return.
  • If is img is green on, the image is successfully loaded. Otherwise, the image fails to be loaded.
  • If is loaded is green on, indicates that the model is loaded. Otherwise, the model is not loaded.
  • If load() return displays 0, the model has been successfully loaded. Otherwise, the module fails to be loaded.
  • If predict() return displays 0, the model prediction success. Otherwise, model prediction failure. Function Call Explanation section defines the various return values for load() return and predict() return.
alt text

Attention: If an error occurs in the program, the problem is found and corrected, and the error still occurs when running again, please restart LabView and run again!!

4. Format of inference result
  • The result of the model's inference on a single image is a string type, which is stored in predict results, as follows:
alt text
  • There can be multiple inference results for a single photo, and the specific format of a single result is:
x0,y0,x1,y1,score,label,label_index,row_index,col_index;mask_width;mask_height;

Note: Results are separated by "," or ";" with no space between them

5. Function Call Explanation
  • dllrun0525.vi cited several vi SDK directory file, which is important:DestroyModel_525.vi, LoadModel_525.vi and PredictModel_525.vi These three files respectively refer: load_model() in neurobot_LabVIEW_Model_SDK_CN_V3.0\bin\neuro_det_sdk.dll, The newPredict_modelVec() and destroy_model() functions (you can open the Block Diagram to see it).
5.1 load_model()
int load_model(const char* model_name, const char* model_path, const char* device_name = "cuda", const int device_index = 0);

  • Definition:
    • This function is used to load the model.
  • Parameter Explanation:
    • Return value:
      • Returns an int type variable. 0 indicates success, and any other numbers are error codes, as shown here:
    5.2 newPredict_modelVec()
    int newPredict_modelVec(const char* model_name, uchar* ImgVec, int length, int row, int col, char* ret, float detect_thres = -1.0);

    • Definition:
      • This function is used to predict the image to be tested.
    • Parameter Explanation:
      • Return value:
        • Returns an int variable. 0 indicates successful execution, and any other numbers are error codes, status code are as follows:
      5.3 destroy_model()
      void destroy_model(const char* model_name);

      • Definition:
        • This function is used to clear the model from the graphics card
      • Parameter Explanation:
      • Return value:
        • None

      Still have a question?

      Each section should be concise, user-friendly, and direct users to additional resources or documentation when necessary.