Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim3:npu:opencv-dnn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
products:sbc:vim3:npu:opencv-dnn [2023/01/13 01:22]
frank
products:sbc:vim3:npu:opencv-dnn [2023/12/25 03:59] (current)
nick
Line 1: Line 1:
 +~~tag> VIM3 OpenCV~~
 +
 ====== OpenCV DNN Usage ====== ====== OpenCV DNN Usage ======
  
 <WRAP important > <WRAP important >
-Just use for VIM3, not in VIM3L.+For [[:VIM3]] only, not for [[:VIM3L]].
 </WRAP> </WRAP>
  
Line 10: Line 12:
  
 ```shell ```shell
-sudo apt install python3 python3-dev python3-numpy cmake +sudo apt update 
-$ sudo apt-get install libgtk2.0-dev+sudo apt install python3 python3-dev python3-numpy cmake libgtk2.0-dev
 ``` ```
  
Line 19: Line 21:
  
 ```shell ```shell
-wget https://dl.khadas.com/development/opencv-4.7.deb +wget https://dl.khadas.com/development/opencv_4.8.1.deb 
-sudo dpkg -i opencv-4.7.deb+sudo dpkg -i opencv_4.8.1.deb
 ``` ```
  
 ===== Run Test ===== ===== Run Test =====
  
-==== Get Demo Source ====+==== Get demo source ====
  
-Get the example repository from Github.+Get the example repository from [[kg>OpenCV_NPU_Demo]].
  
 ```shell ```shell
-cd ~ +cd ~ 
-git clone https://github.com/khadas/OpenCV_NPU_Demo.git+git clone https://github.com/khadas/OpenCV_NPU_Demo.git
 ``` ```
  
Line 39: Line 41:
  
 ```shell ```shell
-cd ~/OpenCV_NPU_Demo/cpp_demo +cd ~/OpenCV_NPU_Demo/cpp_demo 
-mkdir build && cd build +mkdir build && cd build 
-cmake .. +cmake .. 
-make+make
 ``` ```
  
Line 50: Line 52:
  
 ```shell ```shell
-cd ~/OpenCV_NPU_Demo/cpp_demo/build +cd ~/OpenCV_NPU_Demo/cpp_demo/build 
-./detect-camera 1 ../../model/yunet_int8.onnx # My cam is /dev/video1, so there is 1+./detect-camera 1 ../../model/yunet_int8.onnx
 ``` ```
-{{products:sbc:vim3:npu:opencv-c.jpeg}} 
  
 +<WRAP tip >
 +For example my cam device node is ''/dev/video1'', 2nd argument must be ''1''
 +</WRAP>
 +
 +{{products:sbc:vim3:npu:opencv-c.jpeg}}
  
 +===== Quantize Model =====
  
 +We suggest that quantize your model before running on VIM3. If your model performs bad after quantizing, without quantification is okay. Get [[https://github.com/opencv/opencv_zoo/tree/main/tools/quantize|quantized model]]
Last modified: 2023/01/13 01:22 by frank