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
- The trained model file trained at [workbench] (https://www.neurobot.co/modelDevelopmentTool2)
- SDK toolkit (LabView Version)
2.Environment setup
- Supported OS versons: Window10/11 X64 platform
- Software Dependency
- LabView(Minimum Version: 2020) Official download Address: https://www.ni.com/en/support/downloads/software-products/download.labview.html#487445
- LabView Vision Development module (The version corresponds to the LabView version) Official download Address: https://www.ni.com/en/support/downloads/software-products/download.vision-development-module.html#477810
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.
- Video card computing power can be found on Nvidia's official website
- Nvidia graphics driver download Address: https://www.nvidia.com/download/index.aspx Alternate link: https://www.techpowerup.com/download/nvidia-geforce-graphics-drivers/
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:
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".
- Click "New", then click "Browse":
- Select the
bin
folder under the SDK folder:
- Move this environment variable up to the first one:
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)
- If you do not know how to generate the "License.txt" file, you can refer to this document: AI Model Deployment / Activate License
3.4 Modify and run the sample code
- Double-click on the
dllrun0525.vi
file in the SDK folder, as follows:
- Click the folder icon next to
test image path
to select a single test image:
- Modifying the model name
- Click the folder icon next to
model path
to select a folder to store the model file
- Select
device name
(For CPU processing please selectcpu
; for GPU processing please selectcuda
)
- 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 is0.7
)
- Select
color mode
(For color Image (RGB), Please selectcolor
; For grayscale images, selectgray
)
- Click the (run) button in the upper left corner to run the program.
- The results are as follows:
- 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
andpredict() 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 forload() return
andpredict() return
.
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 inpredict results
, as follows:
- 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
andPredictModel_525.vi
These three files respectively refer:load_model()
inneurobot_LabVIEW_Model_SDK_CN_V3.0\bin\neuro_det_sdk.dll
, ThenewPredict_modelVec()
anddestroy_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.