--- license: mit language: - en base_model: - Ultralytics/YOLOv8 pipeline_tag: object-detection tags: - Ultralytics - YOLOv8 --- # YOLOv8 This version of YOLOv8 has been converted to run on the Axera NPU using **w8a16** quantization. This model has been optimized with the following LoRA: Compatible with Pulsar2 version: 5.1 ## Convert tools links: For those who are interested in model conversion, you can try to export axmodel through - [The repo of AXera Platform](https://github.com/AXERA-TECH/ax-samples), which you can get the detial of guide - [Pulsar2 Link, How to Convert ONNX to axmodel](https://pulsar2-docs.readthedocs.io/en/latest/pulsar2/introduction.html) ## Support Platform - AX650 - [M4N-Dock(爱芯派Pro)](https://wiki.sipeed.com/hardware/zh/maixIV/m4ndock/m4ndock.html) - [M.2 Accelerator card](https://axcl-docs.readthedocs.io/zh-cn/latest/doc_guide_hardware.html) - AX630C - [爱芯派2](https://axera-pi-2-docs-cn.readthedocs.io/zh-cn/latest/index.html) - [Module-LLM](https://docs.m5stack.com/zh_CN/module/Module-LLM) - [LLM630 Compute Kit](https://docs.m5stack.com/zh_CN/core/LLM630%20Compute%20Kit) ##Performance Statistics #### AX650N | Model | Latency(ms) npu1 | Latency(ms) npu3 | | :--- | :---: | :---: | | **yolo26n** | 4.112 | 1.410 | | **yolo26s** | 10.173 | 3.549 | | **yolo26m** | 26.824 | 9.389 | | **yolo26l** | 51.532 | 17.858 | | **yolo26x** | 88.379 | 28.892 | #### AX630C | Model | Latency(ms) npu1 | Latency(ms) npu2 | | :--- | :---: | :---: | | **yolo26n** | 14.489 | 8.308 | | **yolo26s** | 31.349 | 23.601 | | **yolo26m** | 80.694 | 57.040 | | **yolo26l** | 143.709 | 100.611 | | **yolo26x** | 244.731 | 158.686 | #### AX615 | Model | Latency(ms) npu1 | Latency(ms) npu2 | | :--- | :---: | :---: | | **yolo26n** | 17.830 | 10.652 | | **yolo26s** | 48.895 | 27.398 | | **yolo26m** | 133.628 | 69.313 | #### AX637 | Model | Latency(ms) npu1 | | :--- | :---: | | **yolo26n** | 4.714 | | **yolo26s** | 11.945 | | **yolo26m** | 28.219 | | **yolo26l** | 53.790 | | **yolo26x** | 84.507 | ## How to use Download all files from this repository to the device ### Inference Input image: ![](./bus.jpg) #### Inference with AX650 Host, such as M4N-Dock(爱芯派Pro) ``` root@ax650:~/ax650# python3 ax_infer.py --model-path yolov8m_640x640_npu3.axmodel --test-img bus.jpg [INFO] Available providers: ['AxEngineExecutionProvider', 'AXCLRTExecutionProvider'] [INFO] Using provider: AxEngineExecutionProvider [INFO] Chip type: ChipType.MC50 [INFO] VNPU type: VNPUType.DISABLED [INFO] Engine version: 2.12.0s [INFO] Model type: 2 (triple core) [INFO] Compiler version: 6.0-dirty a498e20d-dirty [YOLOv8-Det] [13:44:39.169] [DEBUG] Load model time = 483.73 ms [YOLOv8-Det] [13:44:39.205] [DEBUG] Pre-process time = 7.49 ms [YOLOv8-Det] [13:44:39.234] [DEBUG] Forward time = 28.59 ms [YOLOv8-Det] [13:44:39.245] [DEBUG] Post-process time = 10.48 ms [YOLOv8-Det] [13:44:39.249] [INFO] Draw Results (5 objects): [YOLOv8-Det] [13:44:39.250] [INFO] (2, 229, 800, 741) -> bus: 0.97 [YOLOv8-Det] [13:44:39.253] [INFO] (51, 400, 247, 905) -> person: 0.93 [YOLOv8-Det] [13:44:39.254] [INFO] (668, 393, 808, 881) -> person: 0.91 [YOLOv8-Det] [13:44:39.255] [INFO] (221, 403, 343, 859) -> person: 0.89 [YOLOv8-Det] [13:44:39.255] [INFO] (0, 549, 78, 873) -> person: 0.79 [YOLOv8-Det] [13:44:39.281] [INFO] Saved to result_yolov8_det.jpg -------------------------------------- ``` Output image: ![](./result_yolov8_det.jpg)