YOLOv8n
YOLOv8n is the smallest and fastest lightweight vision model in the YOLOv8 series released by Ultralytics. Based on an advanced deep learning architecture, it delivers excellent real-time detection performance with very low compute cost, making it a preferred choice for edge and mobile deployments.
- Key features: Supports high-accuracy real-time object detection, instance segmentation, image classification, and pose estimation (keypoint detection).
- Version notes: This example uses YOLOv8n (Nano). As a lightweight benchmark in the family, it achieves very high FPS with minimal parameters, greatly reducing hardware requirements while maintaining mainstream detection accuracy. It is a strong choice that balances real-time responsiveness and ease of deployment.
Environment setup
You need to set up the environment in advance.
Quick start
Download model files
O6 / O6N
cd ai_model_hub_25_Q3/models/ComputeVision/Object_Detection/onnx_yolov8_n
wget https://www.modelscope.cn/models/cix/ai_model_hub_25_Q3/resolve/master/models/ComputeVision/Object_Detection/onnx_yolov8_n/yolov8n.cix
Test the model
info
Activate the virtual environment before running.
O6 / O6N
python3 inference_npu.py
Full conversion workflow
Download model files
Linux PC
cd ai_model_hub_25_Q3/models/ComputeVision/Object_Detection/onnx_yolov8_n/model
wget https://www.modelscope.cn/models/cix/ai_model_hub_25_Q3/resolve/master/models/ComputeVision/Object_Detection/onnx_yolov8_n/model/yolov8n.onnx
Project structure
├── cfg
├── datasets
├── inference_npu.py
├── inference_onnx.py
├── model
├── ReadMe.md
├── test_data
└── yolov8n.cix
Quantize and convert the model
Linux PC
cd ..
cixbuild cfg/yolov8_nbuild.cfg
Copy to device
After conversion, copy the .cix model files to the device.
Test inference on the host
Run the inference script
Linux PC
python3 inference_onnx.py
Host inference output
Linux PC
$ python3 inference_onnx.py
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 19.24it/s]


Deploy on NPU
Run the inference script
O6 / O6N
python3 inference_npu.py
Inference output
O6 / O6N
$ python3 inference_npu.py
npu: noe_init_context success
npu: noe_load_graph success
Input tensor count is 1.
Output tensor count is 1.
npu: noe_create_job success
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 18.07it/s]
npu: noe_clean_job success
npu: noe_unload_graph success
npu: noe_deinit_context success

