Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim4:npu:demos:yolov7-tiny

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:vim4:npu:demos:yolov7-tiny [2024/12/03 01:43]
louis
products:sbc:vim4:npu:demos:yolov7-tiny [2026/04/02 02:46] (current)
nick
Line 6: Line 6:
  
 {{indexmenu_n>1}} {{indexmenu_n>1}}
 +
 +===== Introduction =====
 +
 +YOLOv7-Tiny is an object detection model. It uses bounding boxes to precisely draw each object in image.
 +
 +Inference results on VIM4.
 +
 +{{:products:sbc:vim4:npu:demos:yolov7-tiny-demo-output.webp?800|}}
 +
 +**Inference speed test**: USB camera about **126ms** per frame.
  
 ===== Train the model ===== ===== Train the model =====
Line 30: Line 40:
 ==== Get the conversion tool ==== ==== Get the conversion tool ====
  
-Download The conversion tool from [[gl>khadas/vim4_npu_sdk]].+You can find the SDK here: [[dl>products/vim4/tools/npu-sdk/]]
  
 ```shell ```shell
-git clone https://gitlab.com/khadas/vim4_npu_sdk +wget https://dl.khadas.com/products/vim4/tools/npu-sdk/vim4_npu_sdk-ddk-3.4.7.7-250508.tgz 
-``` +$ tar xvzf vim4_npu_sdk-ddk-3.4.7.7-250508.tgz 
- +$ cd vim4_npu_sdk-ddk-3.4.7.7-250508
-```shell +
-$ git lfs install +
-$ git lfs clone https://gitlab.com/khadas/vim4_npu_sdk.git +
-$ cd vim4_npu_sdk+
 $ ls $ ls
 adla-toolkit-binary  adla-toolkit-binary-3.1.7.4  convert-in-docker.sh  Dockerfile  docs  README.md adla-toolkit-binary  adla-toolkit-binary-3.1.7.4  convert-in-docker.sh  Dockerfile  docs  README.md
 ``` ```
  
-  * ''adla-toolkit-binary/docs'' - SDK documentations+  * ''docs'' - SDK documentations
   * ''adla-toolkit-binary/bin'' - SDK tools required for model conversion   * ''adla-toolkit-binary/bin'' - SDK tools required for model conversion
   * ''adla-toolkit-binary/demo'' - Conversion examples   * ''adla-toolkit-binary/demo'' - Conversion examples
 +  * ''adla-toolkit-binary/python'' - KSNN conversion examples
  
 <WRAP important> <WRAP important>
-If your kernel is older than 241129, please use version before tag ddk-3.4.7.7.+If your kernel is older than 241129, please use branch npu-ddk-1.7.5.5.
 </WRAP> </WRAP>
  
Line 102: Line 109:
         --quantize-dtype int8 --outdir onnx_output  \         --quantize-dtype int8 --outdir onnx_output  \
         --channel-mean-value "0,0,0,255"  \         --channel-mean-value "0,0,0,255"  \
 +        --inference-input-type "float32" \
 +        --inference-output-type "float32" \
         --source-file dataset.txt  \         --source-file dataset.txt  \
         --batch-size 1 --target-platform PRODUCT_PID0XA003         --batch-size 1 --target-platform PRODUCT_PID0XA003
Line 122: Line 131:
  
 ``` ```
 +
 +<WRAP important>
 +If your kernel is older than 241129, please use version before tag ddk-3.4.7.7.
 +</WRAP>
  
 ==== Install dependencies ==== ==== Install dependencies ====
Line 147: Line 160:
 $ ./yolov7_tiny -m ../data/yolov7_tiny_int8.adla -p ../data/horses.jpg $ ./yolov7_tiny -m ../data/yolov7_tiny_int8.adla -p ../data/horses.jpg
 ``` ```
- 
-{{:products:sbc:vim4:npu:demos:yolov7-tiny-demo-output.webp?800|}} 
  
 === Camera input demo === === Camera input demo ===
Line 163: Line 174:
  
 # Run # Run
-$ ./yolov7_tiny_cap -m ../data/yolov7_tiny_int8.adla -d 0+$ ./yolov7_tiny_cap -m ../data/yolov7_tiny_int8.adla -t usb -d 0
 ``` ```
  
Last modified: 2024/12/03 01:43 by louis