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 00:57] hyphop [Compile and run] |
products:sbc:edge2:npu:demos:yolov7-tiny [2025/04/09 23:10] (current) louis |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ~~tag> YOLO NPU Edge2 RK3588~~ |
+ | |||
+ | ====== | ||
+ | |||
+ | {{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 34: | Line 50: | ||
==== Get convert tool ==== | ==== Get convert tool ==== | ||
- | Download Tool from [[https:// | + | Download Tool from [[gh>rockchip-linux/ |
```shell | ```shell | ||
Line 41: | Line 57: | ||
``` | ``` | ||
- | Install dependences and RKNN toolkit2 packages, | + | Install dependences and RKNN toolkit2 packages. |
```shell | ```shell | ||
Line 51: | Line 67: | ||
``` | ``` | ||
- | ==== convert | + | ==== Convert |
- | After training model, run '' | + | After training model, run '' |
Enter '' | Enter '' | ||
Line 68: | 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 76: | 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 84: | 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 91: | Line 107: | ||
``` | ``` | ||
- | Run '' | + | Run '' |
```shell | ```shell | ||
Line 101: | Line 117: | ||
==== Get source code ==== | ==== Get source code ==== | ||
- | Clone the source code form our [[https:// | + | Clone the source code from our [[gh>khadas/ |
```shell | ```shell | ||
Line 121: | Line 137: | ||
```shell | ```shell | ||
- | # compile | + | # Compile |
$ bash build.sh | $ bash build.sh | ||
- | # run | + | # Run |
$ cd install/ | $ cd install/ | ||
$ ./ | $ ./ | ||
Line 131: | Line 147: | ||
=== Camera input demo === | === Camera input demo === | ||
- | Put '' | + | Put '' |
```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 |
</ | </ | ||