VIM3 NPU demo for SSD MobileNet

@Akkisony Maybe you should use caffe SSD model

@Frank Thank you for letting me know, but is there any reason, why does this not work? Why only caffe model? Can you please shed some inputs?

@Frank @alcohol I have converted the mobilenet.caffemodel to .tmfile(uint8) format.
Now, how do I convert them to .o format, which can be run on Khadas VIM3?

For Yolov3, git clone https://gitlab.com/khadas/tengine_khadas_app.git this repo helped me to do it, is there a similar one for caffe models? @numbqq
CAN YOU PLEASE HELP ME BY REPLYING?
Thank you!

Hey @Frank, is the person detect demo for the latest NN API will be out soon?

I have been waiting for over a month. Thanks in advance.

1 Like

Sorry for waiting such a long time.
an example is:Tengine/tm_mobilenet_ssd_uint8.cpp at tengine-lite Ā· OAID/Tengine Ā· GitHub
The diff between
Tengine/tm_classification.c at tengine-lite Ā· OAID/Tengine Ā· GitHub
and
Tengine/tm_classification_timvx.c at tengine-lite Ā· OAID/Tengine Ā· GitHub
shows how to use Tengine TIM-VX backend on VIM3.

1 Like

@alcohol Thank you for the information and clarity. After converting the model to tengine format(uint8), I used Tengine/tm_mobilenet_ssd_uint8.cpp at tengine-lite Ā· OAID/Tengine Ā· GitHub this for post processing and inference. But, I am gettting several errors with a huge log file. Please look at some of the errors.

  1. Isnt this file using Opencv to import images? If not, then what is it using (which library)?

tm_mobilenet_ssd_uint8.cpp: In function ā€˜void get_input_uint_data_ssd(const char*, uint8_t*, int, int, float, int)ā€™:
tm_mobilenet_ssd_uint8.cpp:57:5: error: ā€˜imageā€™ was not declared in this scope
57 | image img = imread_process(image_file, img_w, img_h, mean, scales);
| ^~~~~
tm_mobilenet_ssd_uint8.cpp:59:35: error: ā€˜imgā€™ was not declared in this scope; did you mean ā€˜img_hā€™?
59 | float* image_data = ( float* )img.data;
| ^~~
| img_h
tm_mobilenet_ssd_uint8.cpp:65:13: error: ā€˜marriedā€™ was not declared in this scope
65 | married = 255 ;
| ^~~~~~~
tm_mobilenet_ssd_uint8.cpp:67:13: error: ā€˜marriedā€™ was not declared in this scope
67 | married = 0 ;
| ^~~~~~~
tm_mobilenet_ssd_uint8.cpp:72:5: error: ā€˜free_imageā€™ was not declared in this scope
72 | free_image(img);

Please can you tell me what am I missing? Your input matters alot for me to debug the problem.
Please note the pretrained model I am using is taken from GitHub - chuanqi305/MobileNet-SSD: Caffe implementation of Google MobileNet SSD detection network, with pretrained weights on VOC0712 and mAP=0.727.. So i believe there is no much chnages required to Tengine/tm_mobilenet_ssd_uint8.cpp at tengine-lite Ā· OAID/Tengine Ā· GitHub this file.
@Frank @alcohol Any inputs? :slight_smile:

@Frank

Is there any particular reason for this?
Can MobileNet-SSD work with NPU using Tengine SDK?
Please let me know your inputs :slight_smile: Thank you!