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 [2023/09/17 23:01]
sravan [Train the model]
products:sbc:vim4:npu:demos:yolov7-tiny [2024/05/31 03:36] (current)
louis
Line 1: Line 1:
 ~~tag> NPU YOLO OpenCV VIM4 ~~ ~~tag> NPU YOLO OpenCV VIM4 ~~
  
-====== YOLOv7 Tiny VIM4 Demo - 1 ======+====== YOLOv7-tiny VIM4 Demo - 1 ======
  
 {{indexmenu_n>1}} {{indexmenu_n>1}}
Line 7: Line 7:
 ===== Train the model ===== ===== Train the model =====
  
-Download the yolov7 official code [[gh>WongKinYiu/yolov7]]+Download the YOLOv7 official code [[gh>WongKinYiu/yolov7]]
  
 ```shell ```shell
Line 13: Line 13:
 ``` ```
  
-Refer ''README.md'' to create and train a yolov7_tiny model.+Refer ''README.md'' to create and train a YOLOv7 tiny model.
 ===== Convert the model ===== ===== Convert the model =====
  
Line 20: Line 20:
 Follow Docker official documentation to install Docker: [[https://docs.docker.com/engine/install/ubuntu/|Install Docker Engine on Ubuntu]]. Follow Docker official documentation to install Docker: [[https://docs.docker.com/engine/install/ubuntu/|Install Docker Engine on Ubuntu]].
  
-Then fetch the prebuilt NPU Docker Container and run it.+Then fetch the prebuilt NPU Docker container and run it.
  
 ```shell ```shell
Line 40: Line 40:
 ==== Convert ==== ==== Convert ====
  
-After training model, modify ''yolov7/models/yolo.py'' as follows.+After training the model, modify ''yolov7/models/yolo.py'' as follows.
  
 ```diff ```diff
Line 57: Line 57:
 ``` ```
  
-Then, run ''export.py'' to convert model to onnx.+<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.
  
 ```shell ```shell
Line 88: Line 92:
 ``` ```
  
-Run ''convert_adla.sh'' to generate 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''.
  
 ```shell ```shell
Line 146: Line 150:
 ``` ```
  
-''0'' is camera device index.+''0'' is the camera device index.
  
 <WRAP tip > <WRAP tip >
-If your **yolov7_tiny** model classes is not the same as **coco**, please change ''data/coco_80_labels_list.txt'' and the ''OBJ_CLASS_NUM'' in ''include/postprocess.h''.+If your **YOLOv7-tiny** model classes are not the same as **COCO**, please change ''data/coco_80_labels_list.txt'' and the ''OBJ_CLASS_NUM'' in ''include/postprocess.h''.
 </WRAP> </WRAP>
  
Last modified: 2023/09/17 23:01 by sravan