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:yolov8n [2023/09/19 21:54] louis |
products:sbc:edge2:npu:demos:yolov8n [2025/06/24 06:02] (current) louis |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ~~tag> YOLO NPU Edge2 RK3588~~ | ~~tag> YOLO NPU Edge2 RK3588~~ | ||
| - | ====== YOLOv8n OpenCV | + | ====== YOLOv8n OpenCV |
| - | ===== Get Source Code ===== | + | {{indexmenu_n> |
| + | |||
| + | ===== Introduction ===== | ||
| + | |||
| + | YOLOv8n 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 **52ms** per frame. MIPI camera about **40ms** per frame. | ||
| + | |||
| + | ===== Train Model ===== | ||
| Download YOLOv8 official code [[gh> | Download YOLOv8 official code [[gh> | ||
| Line 11: | Line 23: | ||
| ``` | ``` | ||
| - | Refer '' | + | Refer '' |
| ===== Convert Model ===== | ===== Convert Model ===== | ||
| Line 59: | Line 71: | ||
| After training model, modify '' | After training model, modify '' | ||
| - | ```diff | + | ```diff |
| diff --git a/ | diff --git a/ | ||
| index 0b02eb3..0a6e43a 100644 | index 0b02eb3..0a6e43a 100644 | ||
| Line 88: | Line 100: | ||
| + | + | ||
| ``` | ``` | ||
| + | |||
| + | <WRAP important> | ||
| + | If you pip-installed ultralytics package, you should modify in package. | ||
| + | </ | ||
| Create a python file written as follows to export **onnx** model. | Create a python file written as follows to export **onnx** model. | ||
| Line 96: | Line 112: | ||
| results = model.export(format=" | results = model.export(format=" | ||
| ``` | ``` | ||
| + | |||
| + | <WRAP important> | ||
| + | Use [[https:// | ||
| + | |||
| + | {{: | ||
| + | </ | ||
| Enter '' | Enter '' | ||
| Line 143: | Line 165: | ||
| ==== Get source code ==== | ==== Get source code ==== | ||
| - | Clone the source code form our [[gh> | + | Clone the source code from our [[gh> |
| ```shell | ```shell | ||
| Line 179: | Line 201: | ||
| $ bash build.sh | $ bash build.sh | ||
| - | # Run | + | # Run USB camera |
| + | $ cd install/ | ||
| + | $ ./ | ||
| + | |||
| + | # Run MIPI camera | ||
| + | $ cd install/ | ||
| + | $ ./ | ||
| + | ``` | ||
| + | |||
| + | <WRAP info > | ||
| + | '' | ||
| + | </ | ||
| + | |||
| + | === Camera input multithreading demo === | ||
| + | |||
| + | Put '' | ||
| + | |||
| + | ```shell | ||
| + | # Compile | ||
| + | $ bash build.sh | ||
| + | |||
| + | # Run USB camera | ||
| + | $ cd install/ | ||
| + | $ ./ | ||
| + | |||
| + | # Run MIPI camera | ||
| $ cd install/ | $ cd install/ | ||
| - | $ ./ | + | $ ./ |
| ``` | ``` | ||
| <WRAP info > | <WRAP info > | ||
| - | '' | + | The last num, '' |
| </ | </ | ||