VIM3 yolov3 convert issue

For the prebuild demo, please use the -h option to get the usage.

khadas@Khadas:~/detect_demo_picture$ ./detect_demo_fb -h
./detect_demo_fb: option requires an argument -- 'h'
./detect_demo_fb [-p picture path] [-w width] [-h height] [-m model type] [-f facenet flag] [-H]

For eaxmple, picture detect demo and display on fb:

$ ./detect_demo_fb -p 1080p.bmp -m 2

The usage changed. We will update the docs.

@Akkisony You must have some changes to the system, so suggest to reflash the latest image here: http://dl.khadas.com/Firmware/VIM3/Ubuntu/EMMC/VIM3_Ubuntu-server-focal_Linux-4.9_arm64_EMMC_V1.0.6-210520.img.xz

I have checked this image, I can build without problems.

khadas@Khadas:~/aml_npu_app/DDK_6.4.4.3/detect_library/model_code/detect_yolo_v3$ ./build_vx.sh 
  COMPILE /home/khadas/aml_npu_app/DDK_6.3.3.4/detect_library/model_code/detect_yolo_v3/yolov3_process.c
  COMPILE /home/khadas/aml_npu_app/DDK_6.3.3.4/detect_library/model_code/detect_yolo_v3/vnn_yolov3.c
vnn_yolov3.c: In function ‘vnn_CreateYolov3’:
vnn_yolov3.c:145:29: warning: unused variable ‘data’ [-Wunused-variable]
  145 |     uint8_t *               data;
      |                             ^~~~
At top level:
vnn_yolov3.c:94:17: warning: ‘load_data’ defined but not used [-Wunused-function]
   94 | static uint8_t* load_data
      |                 ^~~~~~~~~
  COMPILE /home/khadas/aml_npu_app/DDK_6.3.3.4/detect_library/model_code/detect_yolo_v3/yolo_v3.c
make: Nothing to be done for 'all'.
khadas@Khadas:~/aml_npu_app/DDK_6.4.4.3/detect_library/model_code/detect_yolo_v3$ ls bin_r/*.so
bin_r/libnn_yolo_v3.so
khadas@Khadas:~/aml_npu_app/DDK_6.4.4.3/detect_library/model_code/detect_yolo_v3$ 

@numbqq Please let me know when will the new document be uploaded. Also it would be great it you can give a detailed explanation on how to run MobileNet model on VIM3; just like yolov3 tutorial.

One topic for one thing. In this topic we only talk about the yolo model issue.

I have provided the correct usage for yolo picture detect above, please check whether it works for you.

$ ./detect_demo_fb -p 1080p.bmp -m 2
or
$ ./detect_demo_x11 -p 1080p.bmp -m 2

For other model, you need to convert them youself, you can follow the instructions docs from the SDK.

Hello, when using this version under Windows and using USB_Burning_Tool_V2.x.x.exe for USB firmware upgrade, do I need to unzip the file first?

@numbqq Thank you fro your help.
@Frank
I am getting an error for my custom model. Can you please suggest me what needs to be changed in order to overcome the error? I followed the same procedure as mentioned in the khadas website.

I have one doubt as my number of classes is 1, I have set the following parameters:

num_class=1;
coco_names[] = {“holes”};

I hope I have set the right parameters above. Please let me know if I am wrong.


Thank you in advance! @Dhruv_Gaba Do you have an iddea?
Did you face this issue while converting your custom model?

@suixing Yes, you need to unzip first

1 Like

@Frank @numbqq I decided to check and install the reuirements again to build the code using the SDK tool. During this process, I read in the document that, Python requires version 3.5.2. I got to know that in my system, Python version is 3.6.9. Does this cause any problem? Please find the attached screenshot.

If this does not cause problem, please let me know a solution for the above problem. VIM3 yolov3 convert issue - #39 by Akkisony

Thank you!

@Akkisony Can you check with origin source code ? Don’t do any modifiy.

@Frank I can run the demo without any problem. After demo started to work, I have just started to follow your guide and I am trying to convert my own yolov3 model. I have replaced the .cfg file and .weights file and have followed every instrcution as per the manual. Yet, I am not able to use the NPU. :frowning:

Are my above two statements correct?

@Frank I tried with the latest released SDK-6.4.4.3 and I got an output for my Yolov3 model like this.
This is diffreent to what I had got before. Can you please tell me what does the below statement mean?

Does the below statement mean that the object belongs to the class type 0(Since I have only 1 class)?
Unlike the demo, why is it not printing the bounding box co-ordinates?

@Frank

I expected the output to be detect_num = 4, as I have 5 holes in the image.
result type is 0, as I have just one class.

Do you have any reason, why am I not able to detect objects in the image? On PC, with the same weight and config file, I am able to detect the objects in the image! Please help me in this regard!

What’s the resolution of your test image?

@numbqq Resolution = 800*600

I just tried with 416*416. But I am getting error “Segmentation Fault”!

But with resolution 800*600, I am not getting error, but the output is wrong as it says “0”.

Our demo is for 1080P image input, I think you need to modify the code for other resolutions.

@numbqq Thank you for your input.

Please correct me if I am wrong.
I have trained the yolov3 model with 800*600 image. But I guess, however, the model takes input as 416x416 itself. So there is no problem with the training of the model.

  1. Since there are many files, can you please tell me which file do I have to modify?

  2. As an alternative, if I reshape the test image to a resolution of 1080P (1980x1080), will it work?

Thank you for your inputs!

Maybe you can try to specify the width and height:

$ ./detect_demo_x11 -p 1080p.bmp -m 2 -w 800 -h 600

By default, it should work, the test image 1080p.bmp is 1080P.

@numbqq I tried to reshape the image to a resolution of 1080P (1980x1080). Yet, I am getting the same output as shown below. :frowning_face:

OK, could you please provide your orignal test image (800x600) to us to check ?

@numbqq Is it possible to check without my trained .cfg and .weights file?