Image processing in "yolov3_nbg_unify" vs "sample_demo_x11"

There are some include files which are used for image preprocessing of input pictures while using a Yolov3 applications from sample_demo_x11, for example as below:
sample_demo_x11/main.cpp

#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/types_c.h>

#include <ge2d_port.h>
#include <aml_ge2d.h>

While using yolov3_nbg_unify code produced using a recent SDK, there is no such dependencies. It uses inbuilt C processing for pictures.
My question is that:

  1. Can I omit the openv2 and ge2d includes from main.cpp?
  2. Can i use the image preprocessing mechanism used in the yolov3_nbg_unify for image processing?
    I tried incorporating yolov3_nbg_unify code into sample_demo_x11, but could not proceed. As the code in yolov3_nbg_unify only handles 416x416 size and jpeg only images.
    Can you please comment and guide.
    Regards,
    @Frank @numbqq

You can remove ge2d. but if our demo use opencv to process images. If you can proceess images but another way, you can remove opencv.

You can use it , it’s another way.

Yes, the built-in one can only process jpeg images, so we switched to opencv

1 Like

I used yolov3_nbg_unify mechanism to detect the yolov3 images. I input 416x416 jpeg images, but there is not outcome. Also when I tested the same image with a working sample_demo_x11 example, it still does not work. Do you think, a 416x416 size jpeg still be detected using a yolov3 ? Regards

@enggsajjad You test a few more pictures, it should be ok. However, the ones in nbg support fixed size, and only output top5, and will not recognize the picture effect. You still need to modify the postproces yourself

while using the detect_demo_picture/detect_demo_x11, for all images of sizes 416x416 (both jpg, bmp), it gives the following error.

khadas@Khadas:~/hussain/aml_npu_demo_binaries/detect_demo_picture$ ./detect_demo_x11 -m 2 -p ~/hussain/img/416/dog_416.jpg
W Detect_api:[det_set_log_level:19]Set log level=1
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
det_set_log_config Debug
det_set_model success!!

model.width:416
model.height:416
model.channel:3

Segmentation fault
khadas@Khadas:~/hussain/aml_npu_demo_binaries/detect_demo_picture$ ./detect_demo_x11 -m 2 -p ~/hussain/img/416/dog_416.bmp
W Detect_api:[det_set_log_level:19]Set log level=1
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
det_set_log_config Debug
det_set_model success!!

model.width:416
model.height:416
model.channel:3

Segmentation fault
khadas@Khadas:~/hussain/aml_npu_demo_binaries/detect_demo_picture$ ./detect_demo_x11 -m 2 -p ~/hussain/img/416/person_416.bmp
W Detect_api:[det_set_log_level:19]Set log level=1
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
det_set_log_config Debug
det_set_model success!!

model.width:416
model.height:416
model.channel:3

Segmentation fault
khadas@Khadas:~/hussain/aml_npu_demo_binaries/detect_demo_picture$

while for “yolov3_nbg_unify” generated code, it only works for 416x416 jpg images, for other image sizes it does not work. While adapted the pre-processing file from “yolov3_nbg_unify” to “detect_demo_x11”, different files gives wrong results. As I mentioned earlier, my purpose is to implement the yolov3 without c++ openvc dependancies.
Can you please guide, where should I look into for the wrong results?
Regards,
@Frank @numbqq

@enggsajjad This can only be debugged by yourself. You can add some debugging points to check the situation.

Hi,
I can do that now. Below is the example for the standard dog.jpg (416x416) image: