Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:edge2: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:edge2:npu:demos:yolov7-tiny [2023/08/31 05:36]
louis
products:sbc:edge2:npu:demos:yolov7-tiny [2025/04/09 23:10] (current)
louis
Line 1: Line 1:
-~~tag> Yolov7 NPU Edge2 rk3855~~+~~tag> YOLO NPU Edge2 RK3588~~
  
-====== Demo1 Yolov7 Tiny ======+====== YOLOv7-tiny Edge2 Demo - 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 Edge2. 
 + 
 +{{:products:sbc:edge2:npu:demos:yolov7-tiny-result.jpg?800|}} 
 + 
 +**Inference speed test**: USB camera about **43ms** per frame. MIPI camera about **33ms** per frame.
  
 ===== Train Model ===== ===== Train Model =====
  
-Download **yolov7** official codes. Refer ''README.md'' to train a **yolov7_tiny** model.+Download the YOLOv7 official code [[gh>WongKinYiu/yolov7]].
  
 ```shell ```shell
-$ git clone https://github.com/rockchip-linux/rknn-toolkit2.git+$ git clone https://github.com/WongKinYiu/yolov7.git
 ``` ```
 +
 +Refer ''README.md'' to create and train a YOLOv7 tiny model.
  
 ===== Convert Model ===== ===== Convert Model =====
Line 43: Line 57:
 ``` ```
  
-Install dependences and RKNN toolkit2 packages,+Install dependences and RKNN toolkit2 packages.
  
 ```shell ```shell
Line 55: Line 69:
 ==== Convert ==== ==== Convert ====
  
-After training model, run ''export.py'' to convert model from **pt** to **onnx**.+After training model, run ''export.py'' to convert model from **PT** to **ONNX**.
  
 Enter ''rknn-toolkit2/examples/onnx/yolov5'' and modify ''test.py'' as follows. Enter ''rknn-toolkit2/examples/onnx/yolov5'' and modify ''test.py'' as follows.
Line 93: Line 107:
 ``` ```
  
-Run ''test.py'' to generate rknn model.+Run ''test.py'' to generate RKNN model.
  
 ```shell ```shell
Line 103: Line 117:
 ==== Get source code ==== ==== Get source code ====
  
-Clone the source code form our [[gh>khadas/edge2-npu]].+Clone the source code from our [[gh>khadas/edge2-npu]].
  
 ```shell ```shell
Line 139: Line 153:
 $ bash build.sh $ bash build.sh
  
-# Run+# Run USB camera 
 +$ cd install/yolov7_tiny 
 +$ ./yolov7_tiny data/model/yolov7_tiny.rknn usb 60 
 + 
 +# Run MIPI camera
 $ cd install/yolov7_tiny $ cd install/yolov7_tiny
-$ ./yolov7_tiny data/model/yolov7_tiny.rknn 33+$ ./yolov7_tiny data/model/yolov7_tiny.rknn mipi 42
 ``` ```
  
 <WRAP info > <WRAP info >
-''33'' is camera device index+''60'' and ''42'' are camera device index.
 </WRAP> </WRAP>
  
  
 <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/08/31 05:36 by louis