Hi,
when using the default NPU Detect library (libnn_detect.so) with YoloV3 I would like to get more than 10 targets returned by the Npu, especially when elaborating crowed scenes.
I tried to increment MAX_DETECT_NUM to 20 but I always got:
resultData.detect_num=10
I tried to rebuild the lib with the modified #define MAX_DETECT_NUM 20
in the nn_detect_utils.h
without any remarkable results.
I’ve also found that when setting MAX_DETECT_NUM to 20 results are not consistent related to positions values. Below the results I get from the same frame just changing the MAX_DETECT_NUM
The issue auto-solved when I rebuilt the application binary to integrate the code line to set the log level.
Now it works.
Here’s the log:
W Detect_api:[det_set_log_level:19]Set log level=4
W Detect_api:[det_set_log_level:21]output_format not support Imperfect, default to DET_LOG_TERMINAL
W Detect_api:[det_set_log_level:26]Not exist VSI_NN_LOG_LEVEL, Setenv set_vsi_log_error_level
D Detect_api:[det_set_log_config:335]Leave, level:4
D Detect_api:[det_set_model:203]Enter, modeltype:2
Detaching from process 4240
D Detect_api:[check_and_set_dev_type:145]Read Cpuinfo:
processor : 0
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
...
Serial : 290b100001190b00000437304e424e50
Hardware : Khadas VIM3
D Detect_api:[check_and_set_dev_type:146]290 index=1096
I Detect_api:[check_and_set_dev_type:154]set_dev_type REVB and setenv 1
D Detect_api:[check_and_set_function:169]Enter, dlopen so:libnn_yolo_v3.so
D Detect_api:[check_and_set_function:197]Leave, dlopen so:libnn_yolo_v3.so, ret=0
I Detect_api:[det_set_model:221]Start create Model, data_file_path=nn_data
D Detect_api:[det_get_model_size:245]Enter, modeltype:2
D Detect_api:[det_get_model_size:256]Leave, modeltype:2
I Detect_api:[det_set_model:237]input_ptr size=519168, addr=b01c3010
D Detect_api:[det_set_model:239]Leave, modeltype:2
D Detect_api:[det_get_model_size:245]Enter, modeltype:2
D Detect_api:[det_get_model_size:256]Leave, modeltype:2
D Detect_api:[det_set_input:262]Enter, modeltype:2
D Detect_api:[det_get_model_size:245]Enter, modeltype:2
D Detect_api:[det_get_model_size:256]Leave, modeltype:2
D Detect_api:[det_set_input:280]Leave, modeltype:2
D Detect_api:[det_get_result:286]Enter, modeltype:2
D Detect_api:[det_get_result:303]Leave, modeltype:2
To recap: I just had to rebuild both
libnn_detect.so
libnn_yolo_v3.so
with modified #define MAX_DETECT_NUM 20
in the nn_detect_utils.h
@fguerzoni Hello, I was also trying to do object detection using Yolov3. I have trained my model with 3 classes, and I used SDK to convert it for NPU compatability. Now, when I try to detect objects, I am not getting any error, and there is no predicition happening.
I did the inference on PC and there my model is able to predict the objects. Do you have any suggestions for me to fix the problem?
Please find the attached screenshot of the output.