This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
products:sbc:edge2:npu:demos:yolov7-tiny [2023/08/22 05:59] louis created |
products:sbc:edge2:npu:demos:yolov7-tiny [2023/09/20 04:08] (current) hyphop [Compile and run] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ~~tag> YOLO NPU Edge2 RK3588~~ |
+ | |||
+ | ====== | ||
+ | |||
+ | {{indexmenu_n> | ||
===== Train Model ===== | ===== Train Model ===== | ||
- | Download | + | Download |
```shell | ```shell | ||
- | $ git clone https:// | + | $ git clone https:// |
``` | ``` | ||
+ | |||
+ | Refer '' | ||
===== Convert Model ===== | ===== Convert Model ===== | ||
Line 34: | Line 40: | ||
==== Get convert tool ==== | ==== Get convert tool ==== | ||
- | Download Tool from [[https:// | + | Download Tool from [[gh>rockchip-linux/ |
```shell | ```shell | ||
Line 41: | Line 47: | ||
``` | ``` | ||
- | Install dependences and RKNN toolkit2 packages, | + | Install dependences and RKNN toolkit2 packages. |
```shell | ```shell | ||
Line 51: | Line 57: | ||
``` | ``` | ||
- | ==== convert | + | ==== Convert |
- | After training model, run ‘’export.py’’ | + | After training model, run '' |
- | Enter rknn-toolkit2/ | + | Enter '' |
- | ```shell | + | ```python test.py |
# Create RKNN object | # Create RKNN object | ||
rknn = RKNN(verbose=True) | rknn = RKNN(verbose=True) | ||
Line 68: | Line 74: | ||
# 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 82: | ||
# 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 90: | ||
# 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 97: | ||
``` | ``` | ||
- | Run test.py to generate | + | Run '' |
```shell | ```shell | ||
Line 101: | Line 107: | ||
==== Get source code ==== | ==== Get source code ==== | ||
- | Clone the source code form our [[https:// | + | Clone the source code from our [[gh>khadas/ |
```shell | ```shell | ||
Line 118: | Line 124: | ||
=== Picture input demo === | === Picture input demo === | ||
- | Put yolov7_tiny.rknn in edge2-npu/ | + | Put '' |
```shell | ```shell | ||
- | // compile | + | # Compile |
$ bash build.sh | $ bash build.sh | ||
- | // run | + | # Run |
$ cd install/ | $ cd install/ | ||
$ ./ | $ ./ | ||
Line 131: | Line 137: | ||
=== Camera input demo === | === Camera input demo === | ||
- | Put yolov7_tiny.rknn in edge2-npu/ | + | Put '' |
```shell | ```shell | ||
- | // compile | + | # Compile |
$ bash build.sh | $ bash build.sh | ||
- | // run | + | # Run |
$ cd install/ | $ cd install/ | ||
$ ./ | $ ./ | ||
``` | ``` | ||
- | ‘’33’’ | + | <WRAP info > |
+ | '' | ||
+ | </ | ||
<WRAP tip > | <WRAP tip > | ||
- | If your yolov7_tiny | + | If your **YOLOv7 tiny** |
</ | </ | ||