This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
products:sbc:edge2:npu:demos:yolov7-tiny [2023/08/25 02:57] louis |
products:sbc:edge2:npu:demos:yolov7-tiny [2025/04/09 23:10] (current) louis |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ~~tag> | + | ~~tag> |
- | ====== | + | ====== |
+ | |||
+ | {{indexmenu_n> | ||
+ | |||
+ | ===== Introduction ===== | ||
+ | |||
+ | YOLOv7-Tiny is an object detection model. It uses bounding boxes to precisely draw each object in image. | ||
+ | |||
+ | Inference results on Edge2. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | **Inference speed test**: USB camera about **43ms** per frame. MIPI camera about **33ms** per frame. | ||
===== Train Model ===== | ===== Train Model ===== | ||
- | Download | + | Download |
```shell | ```shell | ||
- | $ git clone https:// | + | $ git clone https:// |
``` | ``` | ||
+ | |||
+ | Refer '' | ||
===== Convert Model ===== | ===== Convert Model ===== | ||
Line 43: | Line 57: | ||
``` | ``` | ||
- | Install dependences and RKNN toolkit2 packages, | + | Install dependences and RKNN toolkit2 packages. |
```shell | ```shell | ||
Line 53: | Line 67: | ||
``` | ``` | ||
- | ==== convert | + | ==== Convert |
- | After training model, run '' | + | After training model, run '' |
Enter '' | Enter '' | ||
Line 70: | Line 84: | ||
# Load ONNX model | # Load ONNX model | ||
print(' | print(' | ||
- | ret = rknn.load_onnx(model='' | + | ret = rknn.load_onnx(model=' |
if ret != 0: | if ret != 0: | ||
print(' | print(' | ||
Line 78: | Line 92: | ||
# Build model | # Build model | ||
print(' | print(' | ||
- | ret = rknn.build(do_quantization=True, | + | ret = rknn.build(do_quantization=True, |
if ret != 0: | if ret != 0: | ||
print(' | print(' | ||
Line 86: | Line 100: | ||
# Export RKNN model | # Export RKNN model | ||
print(' | print(' | ||
- | ret = rknn.export_rknn('' | + | ret = rknn.export_rknn(' |
if ret != 0: | if ret != 0: | ||
print(' | print(' | ||
Line 93: | Line 107: | ||
``` | ``` | ||
- | Run '' | + | Run '' |
```shell | ```shell | ||
Line 103: | Line 117: | ||
==== Get source code ==== | ==== Get source code ==== | ||
- | Clone the source code form our [[gh> | + | Clone the source code from our [[gh> |
```shell | ```shell | ||
Line 123: | Line 137: | ||
```shell | ```shell | ||
- | # compile | + | # Compile |
$ bash build.sh | $ bash build.sh | ||
- | # run | + | # Run |
$ cd install/ | $ cd install/ | ||
$ ./ | $ ./ | ||
Line 136: | Line 150: | ||
```shell | ```shell | ||
- | # compile | + | # Compile |
$ bash build.sh | $ bash build.sh | ||
- | # run | + | # Run USB camera |
+ | $ cd install/ | ||
+ | $ ./ | ||
+ | |||
+ | # Run MIPI camera | ||
$ cd install/ | $ cd install/ | ||
- | $ ./ | + | $ ./ |
``` | ``` | ||
<WRAP info > | <WRAP info > | ||
- | '' | + | '' |
</ | </ | ||
<WRAP tip > | <WRAP tip > | ||
- | If your **yolov7_tiny** model classes | + | If your **YOLOv7 tiny** model classes |
</ | </ | ||