NK-YOLO is a comprehensive object detection benchmark built on Jittor, providing state-of-the-art YOLO implementations with automatic compilation and optimized performance.
π Documentation | π Quick Start | π― Models | π Results
- π₯ Automatic Compilation: No manual CUDA/C++ compilation required
- π Multi-Model Support: YOLOv5, YOLOv6, YOLOv7, YOLOv8, YOLOv10, YOLO-MS
- β‘ High Performance: Optimized for speed and accuracy
- π― Easy Training: Simple training pipeline with comprehensive configuration
- π Rich Evaluation: Built-in validation and testing tools
- π οΈ Cross-Platform: Support for Linux, macOS, and WSL
Model | Paper | Repository | Status |
---|---|---|---|
YOLOv5 | Paper | ultralytics/yolov5 | β |
YOLOv6 | Paper | meituan/YOLOv6 | β |
YOLOv7 | Paper | WongKinYiu/yolov7 | β |
YOLOv8 | Paper | ultralytics/ultralytics | β |
YOLOv10 | Paper | THU-MIG/yolov10 | β |
YOLO-MS β | Paper | FishAndWasabi/YOLO-MS | β |
- OS: Linux (Ubuntu/CentOS/Arch), macOS, or Windows Subsystem for Linux (WSL)
- Python: >= 3.7
- CPU Compiler: g++ (>=5.4.0) or clang (>=8.0)
- GPU Compiler (Optional): nvcc (>=10.0 for g++ or >=10.2 for clang)
- GPU Library: cudnn-dev (recommended tar file installation)
git clone https://github.com/NK-JittorCV/nk-yolo.git
cd nk-yolo
python -m pip install -r requirements.txt
π‘ Note: If you encounter Jittor installation issues, please refer to the Jittor Installation Guide.
# Option 1: Install in development mode
pip install -v -e .
# Option 2: Install with user permissions (if needed)
pip install -v -e . --user
python demo.py
This will:
- Train a YOLOv8 model on COCO8 dataset for 2 epochs
- Evaluate the model performance
- Run inference on sample images
from nkyolo import YOLO
# Load a model
model = YOLO('yolov8n.yaml')
# Train the model
results = model.train(
data='coco8.yaml',
epochs=100,
imgsz=640,
batch=16,
device='cpu' # or '0' for GPU
)
# Validate the model
metrics = model.val()
# Run inference
results = model('path/to/image.jpg')
results[0].show()
Create a YAML configuration file for your dataset:
# dataset.yaml
path: ../datasets/coco # dataset root directory
train: images/train2017 # train images (relative to 'path')
val: images/val2017 # val images (relative to 'path')
# Classes
names:
0: person
1: bicycle
2: car
# ... more classes
python -m nkyolo.models.yolo.detect.train \
--model yolov8n.yaml \
--data coco.yaml \
--epochs 100 \
--imgsz 640 \
--batch 16 \
--device cpu
python -m nkyolo.models.yolo.detect.train \
--model yolov8n.yaml \
--data coco.yaml \
--epochs 100 \
--imgsz 640 \
--batch 16 \
--device 0 \
--workers 8 \
--patience 50 \
--save-period 10 \
--cache ram
Parameter | Description | Default |
---|---|---|
--model |
Model configuration file | yolov8n.yaml |
--data |
Dataset configuration file | coco.yaml |
--epochs |
Number of training epochs | 100 |
--imgsz |
Input image size | 640 |
--batch |
Batch size | 16 |
--device |
Device to run on (cpu/0/0,1,2,3) | cpu |
--workers |
Number of worker threads | 8 |
--patience |
Early stopping patience | 50 |
--save-period |
Save checkpoint every N epochs | -1 |
--cache |
Cache images (ram/disk) | False |
# YOLOv8
python -m nkyolo.models.yolo.detect.train --model yolov8n.yaml
# Validate a trained model
python -m nkyolo.models.yolo.detect.train \
--model ${CKPT_PATH} \
--data coco.yaml \
--task val
from nkyolo import YOLO
# Load trained model
model = YOLO(${CKPT_PATH})
# Single image inference
results = model('path/to/image.jpg')
results[0].show()
results[0].save('output.jpg')
# Batch inference
results = model(['image1.jpg', 'image2.jpg', 'image3.jpg'])
# Video inference
results = model('video.mp4')
# Evaluate model performance
python -m nkyolo.models.yolo.detect.train \
--model runs/train/exp/weights/best.pt \
--data coco.yaml \
--task val \
--conf 0.001 \
--iou 0.6
Model | Test Size | #Params | FLOPs | APval | Latency |
---|---|---|---|---|---|
YOLOv10-N | 640 | 2.3M | 6.7G | 38.5% | 1.84ms |
YOLOv10-S | 640 | 7.2M | 21.6G | 46.3% | 2.49ms |
YOLOv10-M | 640 | 15.4M | 59.1G | 51.1% | 4.74ms |
YOLOv10-B | 640 | 19.1M | 92.0G | 52.5% | 5.74ms |
YOLOv10-L | 640 | 24.4M | 120.3G | 53.2% | 7.28ms |
YOLOv10-X | 640 | 29.5M | 160.4G | 54.4% | 10.70ms |
nk-yolo/
βββ nkyolo/ # Main package
β βββ cfg/ # Configuration files
β β βββ datasets/ # Dataset configurations
β β βββ models/ # Model configurations
β βββ data/ # Data loading and processing
β βββ engine/ # Training engine
β βββ models/ # Model implementations
β βββ nn/ # Neural network modules
β βββ utils/ # Utility functions
βββ datasets/ # Dataset storage
βββ runs/ # Training outputs
βββ demo.py # Demo script
βββ requirements.txt # Dependencies
We welcome contributions! Please see our Contributing Guidelines for details.
This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.
This project is built on top of these excellent open-source projects:
- Jittor - Deep learning framework
- ultralytics - YOLOv8 implementation
- yolov10 - YOLOv10 implementation
If you find this work useful for your research, please cite:
@article{hu2020jittor,
title={Jittor: a novel deep learning framework with meta-operators and unified graph execution},
author={Hu, Shi-Min and Liang, Dun and Yang, Guo-Ye and Yang, Guo-Wei and Zhou, Wen-Yang},
journal={Science China Information Sciences},
volume={63},
number={222103},
pages={1--21},
year={2020}
}
@article{Chen2025,
title = {YOLO-MS: Rethinking Multi-Scale Representation Learning for Real-time Object Detection},
ISSN = {1939-3539},
url = {http://dx.doi.org/10.1109/TPAMI.2025.3538473},
DOI = {10.1109/tpami.2025.3538473},
journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence},
publisher = {Institute of Electrical and Electronics Engineers (IEEE)},
author = {Chen, Yuming and Yuan, Xinbin and Wang, Jiabao and Wu, Ruiqi and Li, Xiang and Hou, Qibin and Cheng, Ming-Ming},
year = {2025},
pages = {1β14}
}
@article{wang2024yolov10,
title={YOLOv10: Real-Time End-to-End Object Detection},
author={Wang, Ao and Chen, Hui and Liu, Lihao and Chen, Kai and Lin, Zijia and Han, Jungong and Ding, Guiguang},
journal={arXiv preprint arXiv:2405.14458},
year={2024}
}
Made with β€οΈ by the NK-YOLO Team
β Star this repo | π Report Issues | π Documentation