NPU Demo and source code

There are some ready to use NPU demo binaries for VIM3/VIM3L.

This documentation is about how to run these demos on VIM3/VIM3L.


You need to run Ubuntu image V20190830 on board, and update the system.

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

Note: You can choose server image to run these demos. If you choose desktop image, you need to switch to the framebuffer console by Ctrl+Alt+F1 to run these demos.

Download NPU demo binaries

khadas@Khadas:~$ sudo -i
root@Khadas:~# git clone --depth=1

Directory description:

  • detect_demo - Yoloface/YoloV2/YoloV3 demo with video
  • detect_demo_picture - Yoloface/YoloV2/YoloV3 demo with picture
  • inceptionv3 - Inceptionv3

Run Yolo demo with USB camera

Install the libraries:

root@Khadas:~# cd aml_npu_demo_binaries/detect_demo
root@Khadas:~/aml_npu_demo_binaries/detect_demo# ./INSTALL

Run UVC demo:

root@Khadas:~/aml_npu_demo_binaries/detect_demo# ./detect_demo_uvc /dev/videoX 1 > /dev/null

Note: Replace /dev/videoX to the correct node.

You can run ./detect_demo_uvc to get help information and read README to get more information.

Tested USB camera:

  • Logitech C920 PRO
  • Logitech C525

Run Yolo demo with MIPI camera

root@Khadas:~/aml_npu_demo_binaries/detect_demo# ./detect_demo_mipi /dev/videoX  1 > /dev/null

Note: MIPI camera for VIM3 has not launched yet.

Source Code

The source code of the demos:

In The End

The performance of the video display still need to improve.


Thank you @numbqq . I was looking out for this.
I’ll check it out when I find the time and make a video about it.
Just got the NVIDIA Jetson Nano. So could be nice to do a comparison of both.
The Nano may have a good GPU, but its CPU is mighty slow. Can’t be said about the VIM3.

I got the following error when I run detect_demo in the detect_demo_picture directory:

./detect_demo: error while loading shared libraries: cannot open shared object file: No such file or directory

Where can I install

Can you provide this for me? ldd detect_demo ? (0x0000007f89f97000) => /lib/ (0x0000007f89e53000) => /lib/aarch64-linux-gnu/ (0x0000007f89d99000) => /lib/aarch64-linux-gnu/ (0x0000007f89d6d000) => /lib/aarch64-linux-gnu/ (0x0000007f89d58000) => /lib/aarch64-linux-gnu/ (0x0000007f89d2b000) => /home/khadas/USBDrive/nanopi/opencv/build/lib/ (0x0000007f8993b000) => /home/khadas/USBDrive/nanopi/opencv/build/lib/ (0x0000007f895e5000) => /home/khadas/USBDrive/nanopi/opencv/build/lib/ (0x0000007f89593000) => /home/khadas/USBDrive/nanopi/opencv/build/lib/ (0x0000007f89397000) => /home/khadas/USBDrive/nanopi/opencv/build/lib/ (0x0000007f89372000) => /usr/lib/ (0x0000007f8935e000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f891cb000) => /lib/aarch64-linux-gnu/ (0x0000007f891b4000) => /lib/aarch64-linux-gnu/ (0x0000007f89190000) => /lib/aarch64-linux-gnu/ (0x0000007f89037000) => /lib/ (0x0000007f88eab000) => /lib/ (0x0000007f88e95000) => /lib/ (0x0000007f88c84000) => /lib/ (0x0000007f87dde000)
    /lib/ (0x0000007f89f6c000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f86b98000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f86961000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f868d1000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8685d000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f86813000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f867d8000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8675d000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f86101000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f86019000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f85f1f000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f85ef0000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f85e92000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f85d84000) => /lib/ (0x0000007f85c00000) => /lib/ (0x0000007f85768000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f85740000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f856e8000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f856b9000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8562a000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f85543000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f852e5000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8517f000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f85166000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f85134000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84f89000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84eda000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84ea4000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84e73000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84e31000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84e0a000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84de5000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84dcd000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84db3000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84d73000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84d26000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84ccb000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84c4f000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84c35000) => /lib/aarch64-linux-gnu/ (0x0000007f84c05000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84b8d000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f849c5000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8496e000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84811000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84672000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84619000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f845f7000) => /lib/aarch64-linux-gnu/ (0x0000007f845d7000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f844ae000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8448f000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8447b000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84464000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84451000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84434000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84420000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84404000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f843e4000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f843ce000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f843b5000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84381000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84343000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8424f000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8422a000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f841d3000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84183000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f84007000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83ff4000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83fda000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83fbf000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83fac000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83f99000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83f4f000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83f37000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83f25000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83f06000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83ee6000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83e82000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83dd9000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83dc6000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83d96000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83d79000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83d60000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83d48000) => /lib/aarch64-linux-gnu/ (0x0000007f83cd6000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83c75000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83c55000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83c3e000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83bfa000) => /lib/aarch64-linux-gnu/ (0x0000007f83b3f000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83aec000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83a8f000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83a77000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83965000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83939000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f837b6000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83795000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83752000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83711000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83694000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f834bf000) => /lib/aarch64-linux-gnu/ (0x0000007f8346b000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8342f000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8338f000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83377000) => /lib/aarch64-linux-gnu/ (0x0000007f83338000) => /lib/aarch64-linux-gnu/ (0x0000007f83303000) => /lib/aarch64-linux-gnu/ (0x0000007f832de000) => /lib/aarch64-linux-gnu/ (0x0000007f83281000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8326e000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83259000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8321a000) => /lib/aarch64-linux-gnu/ (0x0000007f831f8000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f83129000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f830eb000) => /lib/aarch64-linux-gnu/ (0x0000007f830d7000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f830bd000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f81702000) => /lib/aarch64-linux-gnu/ (0x0000007f8167e000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8164d000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f81637000) => /lib/aarch64-linux-gnu/ (0x0000007f815e2000) => /lib/aarch64-linux-gnu/ (0x0000007f815be000) => /lib/aarch64-linux-gnu/ (0x0000007f815aa000) => /usr/lib/aarch64-linux-gnu/ (0x0000007f8157e000) => /lib/aarch64-linux-gnu/ (0x0000007f81567000)

Install gtk3:
sudo apt-get install libgtk-3-0 libgtk-3-bin libgtk-3-common

@kaishi Would you install the libgtk-3-0 libgtk-3-bin libgtk-3-common ?

After installing libgtk, it works now,
Adding time duration code to profile performance of yolo3, it takes 100ms to finish one picture. Does this number sound right?


how to make the sources?

@RichardG You can refer to those docs.

I am able to train Yolo on intel / linux / nvidia platform.
I am able to modify darknet also image.c
I am able to download demo binaries and run the picture demo.
but after downloading
i want to modify the khadas demo to accept rtsp input
but I cant make the sources.
Any advise will be greatly appreciated. inline display

@RichardG You need to Application for DDK by email.

ok email application sent

how did you modify and compile the source code?
appreciate any advise.

Have applied a few days back, pls respond.
Need to get the 5 TOP npu working urgently

@RichardG Sorry for that . We will check it. Maybe it’s an automated response .
What is your email address. @tsangyoujun can reply to you manually.


@tsangyoujun Please help him . THX

Yes already PMed him :smile:

1 Like

It’s weird. Anyone that ran the inception_v3 example successfully? How did you enable /dev/galcore (device node file) to run the inception_v3 (ELF file)?

khadas@Khadas:~/mywork/aml_npu_demo_binaries/inceptionv3/VIM3$ ./
[ 1] Failed to open device: No such file or directory, Try again…
[ 2] Failed to open device: No such file or directory, Try again…
[ 3] Failed to open device: No such file or directory, Try again…
[ 4] Failed to open device: No such file or directory, Try again…
[ 5] _OpenDevice(1205): FATAL: Failed to open device, errno=No such file or directory.