VIM3 NPU demo for SSD MobileNet

NPU Demo from the Toolkit works well for Yolo. Many frameworks can be converted using acuity toolkit, there is an example of custom Yolo Model here

I tried it and I could not make other network models work. There are no examples for transforming any common networks like MobileNet. If I run the three conversion scripts in the SDK, by default, “nbg_unify_mobilenet_tf” is created. However, there is no information on how to transform this into model code in the amu_npu_app and build them successfully. Where can I find this information about creating demo mobilenet code similar to yolo?

Any help would be appreciated here. Thanks.

1 Like

@Vignesh_Raja SSD model can’t convert with convert tools . You need to remove the input layer and output layer, then you can convert it . After convert it , you need to implement the input and output layers yourself in your code.

Thanks for the quick reply. I see, any documentation on how to work with SSD model?

The conversion scripts did worked with regular “mobilenet_v1.pb”. By default, there is even in folder called “normal_case_demo” under acuity-toolkit in aml_npu_sdk_6.4.3. This seems to be the converted mobilenet model. I have attached the link here

https://drive.google.com/drive/folders/1Kbm_FjjpjRZ5Tuj0piVnnq0vA0CwgOW_?usp=sharing

Therefore I asked how can I get from here to have executable demo file like “detect_demo_x11_usb” (quite similar to Yolo Demos).

I see these are the models that NN can be supported. It would be really helpful if there are documentation on how to convert each of them (especially if there are any differences in conversion like SSD) and deploy them. And, are they any converted models .nb and .so files that can be open-sourced?

@Vignesh_Raja Maybe NN Tool FAQ Docs can help you .

1 Like

I don’t have that section in NN Tool FAQ Docs. I have only until 3.7. How can I get updated Docs file?

@Vignesh_Raja NN Tool FAQ (0.4)

1 Like

Please tell me, did you manage to launch mobile net_tf? I got the same files as you using conversion_scripts, but I don’t understand how to use it

No, I could not make it work. There is no documentation on what to do after the conversion. I switched to this API that released few months back

It is much more user friendly and can support MobileNet as well.

3 Likes

Thank you for the advice
I made from the site that you threw the “Compilation method”, but then I can not understand how to run since the instructions are completely different files. Could you briefly describe your sequence of actions?

image_classify will work in the master branch. But for others,

First, go to previous commit that contains person detect file
Files · 789ee9a7ef3e6b31f60f205b14fcf2a0fece9f47 · khadas / aml_npu_nnsdk_app · GitLab

API is loaded from libnnsdk.so file under /usr/lib/ (this is defined in makefile.linux)

Follow this steps

  • ./build-cv3.sh
  • $ wget amlogic · GitHub NN/AML_NN_SDK/raw/master/Model/DDK6.4.3/88/person_detect_88.nb
  • $ ./person_detect_640x384_picture ./person_detect_88.nb < path to jpeg file>
  • $ ./person_detect_640x384_camera ./person_detect_88.nb < path to camera node>

Note

Make sure you have OpenCV 3.4 installed because the “nnSDK” library looks for this. You can make it work for OpenCV4.2 but then change the API at few places where OpenCV are used in the code.

1 Like

Do you do this on a board or computer?
I can’t find the “nn_sdk” folder where the “-lnnsdk " library should be”

On board. I think you have to install few libraries.

khadas@Khadas:~$ sudo apt-get update
khadas@Khadas:~$ sudo apt-get upgrade
khadas@Khadas:~$ sudo apt-get install -y gstreamer1.0-libav gstreamer1.0-plugins-bad gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer1.0-alsa gstreamer1.0-plugins-good libconfig++9v5 libconfig9
khadas@Khadas:~$ sudo apt-get install -y aml-npu
khadas@Khadas:~$ sudo apt-get install -y gstreamer-aml libplayer-aml opencv3
khadas@Khadas:~$ sync
khadas@Khadas:~$ sudo reboot

1 Like

@ilya71 Do you upgrade you system ? You need to use the latest OTA release

Could my problem be due to the fact that I am using Ubuntu 20.04, and not as indicated in the manual?

Thank you so much @Frank and @Vignesh_Raja for your help.
I removed the aml-npu and installed it again and there were fewer errors, but I solved the problem with opencv by building it through cmake files and a demo from here How to Compile and Use Amlogic NN Api demo | Khadas Documentation it started to run.
Please tell me what should be the next steps if I want to learn how to run my neural network on NPU? I have seen further chapters of the manual show how to get tmfile, but even if I do this, then I do not understand how to use it. I also saw the code for quantizing and converting the model in the engine tools, but there are examples for the same functionality in am_npu_sdk. Which one should I use?

@ilya71 Hello,

Tengine SDK and Tengine APP is another system.

If you want to use Tengine ,you can follow this ,

@Frank

After the latest upgrade of aml-npu, “person_detect_640x384” in the aml_npu_nnsdk_app does not doing any inference anymore.

Does few things changed in the new updates?

@Vignesh_Raja hello , about the new nn api , there is a big change, so the old demo can no longer be used . So you need to push the leaet release demo code . But it just suppport image_classify_224x224. others I will fixup it and faceback there

Oh, I see. When can we except a new sample code for person detection?

It would be nice to get the release notes of the new changes in the nn api. And also have one stable aml-npu version where we could revert back.

From next time, is storing libnnsdk.so locally instead of Debian will help although I am wondering about other dependencies of nnsdk which will be still in debian?

@Vignesh_Raja I can’t give a specific time, it’s already in my work schedule, but I still have many other jobs

2 Likes