~~tags>VIM4 NPU~~ **Doc for version ddk-3.4.7.7** ====== NPU Applications ====== {{indexmenu_n>1}} Only **New VIM4** supports NPU, you can check the version of your VIM4 here: [[products:sbc:vim4:configurations:identify-version|]] ===== Linux ===== Only supports OpenCV4. ==== Get source code ==== You need to download the source code to your VIM4 board and compile on it. Clone the NPU demo applications to somewhere, e.g. ''~/workspace'': ```shell $ mkdir ~/workspace $ cd ~/workspace $ git clone https://github.com/khadas/vim4_npu_applications $ cd vim4_npu_applications $ ls densenet_ctc facenet face_recognition face_recognition_cap retinaface retinaface_cap vgg16 yolov3 yolov3_cap yolov7_tiny yolov7_tiny_cap yolov8n yolov8n_cap ``` * ''densenet_ctc'', ''facenet'', ''retinaface'', ''yolov3'', ''yolov7_tiny'', ''yolov8n'' - Different demo for VIM4 NPU. Please use convert tool version tag ddk-3.4.7.7 or higher. ==== Install dependences ==== ```shell $ sudo apt update $ sudo apt install libopencv-dev python3-opencv cmake ``` ==== Compile ==== Take ''yolov3'' as an example, other demos are the same. ```shell $ cd yolov3 $ mkdir build && cd build $ cmake .. $ make ``` ==== Run ==== === Yolov3 === The demos of the Yolo series only support running under the desktop environment. Before running, please compile the source code. The compilation method is same as ''Mobilenet V2''. Detect picture: ```shell $ cd yolov3/build $ ./yolov3 -p ../data/1080p.bmp -m ../data/det_yolov3_int8.adla ``` {{:products:sbc:vim4:npu:vim4-yolov3-output.webp?1000|}} Detection with camera: ```shell $ cd yolov3_cap/build $ ./yolov3_cap -m ../data/det_yolov3_int8.adla -d X -w 1920 -h 1080 ``` **x**: the number for you camera device. such as ''/dev/video0'', ''x'' is ''0''. ===== Android ===== WIP: