This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
products:sbc:vim4:npu:demos:yolov8n [2024/02/17 22:43] louis |
products:sbc:vim4:npu:demos:yolov8n [2025/01/08 22:22] (current) louis |
||
---|---|---|---|
Line 1: | Line 1: | ||
~~tag> NPU YOLO OpenCV VIM4 ~~ | ~~tag> NPU YOLO OpenCV VIM4 ~~ | ||
+ | |||
+ | **Doc for version ddk-3.4.7.7** | ||
====== YOLOv8n OpenCV VIM4 Demo - 2 ====== | ====== YOLOv8n OpenCV VIM4 Demo - 2 ====== | ||
Line 12: | Line 14: | ||
``` | ``` | ||
- | Refer '' | + | Refer '' |
===== Convert Model ===== | ===== Convert Model ===== | ||
Line 20: | Line 22: | ||
Follow Docker official documentation to install Docker: [[https:// | Follow Docker official documentation to install Docker: [[https:// | ||
- | Then fetch the prebuilt NPU Docker | + | Follow |
```shell | ```shell | ||
- | $ docker pull yanwyb/npu:v1 | + | docker pull numbqq/npu-vim4 |
- | $ docker run -it --name | + | |
- | -v / | + | |
- | -v / | + | |
- | yanwyb/ | + | |
``` | ``` | ||
==== Get Model Conversion Tools ==== | ==== Get Model Conversion Tools ==== | ||
- | Get source [[gl> | + | Get source [[gh> |
```shell | ```shell | ||
- | $ git clone https://gitlab.com/ | + | $ git lfs install |
+ | $ git lfs clone https://github.com/ | ||
+ | $ cd vim4_npu_sdk | ||
+ | $ ls | ||
+ | adla-toolkit-binary | ||
``` | ``` | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | <WRAP important> | ||
+ | If your kernel is older than 241129, please use branch npu-ddk-1.7.5.5. | ||
+ | </ | ||
==== Convert ==== | ==== Convert ==== | ||
Line 66: | Line 76: | ||
+ dfl = self.cv2[i](x[i]).contiguous() | + dfl = self.cv2[i](x[i]).contiguous() | ||
+ cls = self.cv3[i](x[i]).contiguous() | + cls = self.cv3[i](x[i]).contiguous() | ||
- | + | + | + results.append(torch.cat([cls, |
- | + # results.append(torch.cat([cls, | + | |
+ return tuple(results) | + return tuple(results) | ||
+ | + | ||
Line 91: | Line 100: | ||
Use [[https:// | Use [[https:// | ||
- | {{: | + | {{: |
</ | </ | ||
Line 115: | Line 124: | ||
--quantize-dtype int16 --outdir onnx_output | --quantize-dtype int16 --outdir onnx_output | ||
--channel-mean-value " | --channel-mean-value " | ||
+ | --inference-input-type " | ||
+ | --inference-output-type " | ||
--source-file dataset.txt | --source-file dataset.txt | ||
--batch-size 1 --target-platform PRODUCT_PID0XA003 | --batch-size 1 --target-platform PRODUCT_PID0XA003 | ||
Line 134: | Line 145: | ||
$ git clone https:// | $ git clone https:// | ||
``` | ``` | ||
+ | |||
+ | <WRAP important> | ||
+ | If your kernel is older than 241129, please use version before tag ddk-3.4.7.7. | ||
+ | </ | ||
==== Install dependencies ==== | ==== Install dependencies ==== | ||
Line 157: | Line 172: | ||
# Run | # Run | ||
- | $ sudo ./yolov8n -m ../ | + | $ ./yolov8n -m ../ |
``` | ``` | ||
+ | |||
+ | {{: | ||
=== Camera input demo === | === Camera input demo === | ||
Line 173: | Line 190: | ||
# Run | # Run | ||
- | $ sudo ./ | + | $ ./ |
``` | ``` | ||