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/01/04 04:46]
louis
products:sbc:vim4:npu:demos:yolov7-tiny [2024/05/31 03:36] (current)
louis
Line 56: Line 56:
                  if self.grid[i].shape[2:4] != x[i].shape[2:4]:                  if self.grid[i].shape[2:4] != x[i].shape[2:4]:
 ``` ```
 +
 +<WRAP important>
 +yolo.py has many forward. Right place is class **IDetect** function **fuseforward**.
 +</WRAP>
  
 Then, run ''export.py'' to convert the model to ONNX. Then, run ''export.py'' to convert the model to ONNX.
Line 81: Line 85:
         --inputs "images" \         --inputs "images" \
         --input-shapes  "3,640,640"  \         --input-shapes  "3,640,640"  \
-        --inference-input-type float32 \ 
- --inference-output-type float32 \ 
         --dtypes "float32" \         --dtypes "float32" \
         --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"  \
         --source-file dataset.txt  \         --source-file dataset.txt  \
-        --iterations 500 \ 
-        --disable-per-channel False \ 
         --batch-size 1 --target-platform PRODUCT_PID0XA003         --batch-size 1 --target-platform PRODUCT_PID0XA003
 ``` ```
- 
-<WRAP important > 
-Please prepare about 500 pictures for quantification. If the pictures size is smaller than model input size, please resize pictures to input size before quantification. 
-</WRAP> 
  
 Run ''convert_adla.sh'' to generate the VIM4 model. The converted model is ''xxx.adla'' in ''onnx_output''. Run ''convert_adla.sh'' to generate the VIM4 model. The converted model is ''xxx.adla'' in ''onnx_output''.
Line 110: Line 106:
 ```shell ```shell
 $ git clone https://github.com/khadas/vim4_npu_applications $ git clone https://github.com/khadas/vim4_npu_applications
 +
 ``` ```
- 
-<WRAP important > 
-If your kernel version is 5.4 or earlier, please use tag ''ddk-1.7.5.5''. Tag ''ddk-2.3.6.7'' is for 5.15. 
-</WRAP> 
  
 ==== Install dependencies ==== ==== Install dependencies ====
Last modified: 2024/01/04 04:46 by louis