MCPcopy
hub / github.com/THU-MIG/yolov10

github.com/THU-MIG/yolov10 @v1.1 sqlite

repository ↗ · DeepWiki ↗ · release v1.1 ↗
1,893 symbols 6,703 edges 155 files 1,840 documented · 97%
README

YOLOv10: Real-Time End-to-End Object Detection

Official PyTorch implementation of YOLOv10.

Comparisons with others in terms of latency-accuracy (left) and size-accuracy (right) trade-offs.

YOLOv10: Real-Time End-to-End Object Detection.\ Ao Wang, Hui Chen, Lihao Liu, Kai Chen, Zijia Lin, Jungong Han, and Guiguang Ding\ arXiv Open In Colab Hugging Face Spaces Transformers.js Demo

Abstract

Over the past years, YOLOs have emerged as the predominant paradigm in the field of real-time object detection owing to their effective balance between computational cost and detection performance. Researchers have explored the architectural designs, optimization objectives, data augmentation strategies, and others for YOLOs, achieving notable progress. However, the reliance on the non-maximum suppression (NMS) for post-processing hampers the end-to-end deployment of YOLOs and adversely impacts the inference latency. Besides, the design of various components in YOLOs lacks the comprehensive and thorough inspection, resulting in noticeable computational redundancy and limiting the model's capability. It renders the suboptimal efficiency, along with considerable potential for performance improvements. In this work, we aim to further advance the performance-efficiency boundary of YOLOs from both the post-processing and the model architecture. To this end, we first present the consistent dual assignments for NMS-free training of YOLOs, which brings the competitive performance and low inference latency simultaneously. Moreover, we introduce the holistic efficiency-accuracy driven model design strategy for YOLOs. We comprehensively optimize various components of YOLOs from both the efficiency and accuracy perspectives, which greatly reduces the computational overhead and enhances the capability. The outcome of our effort is a new generation of YOLO series for real-time end-to-end object detection, dubbed YOLOv10. Extensive experiments show that YOLOv10 achieves the state-of-the-art performance and efficiency across various model scales. For example, our YOLOv10-S is 1.8$\times$ faster than RT-DETR-R18 under the similar AP on COCO, meanwhile enjoying 2.8$\times$ smaller number of parameters and FLOPs. Compared with YOLOv9-C, YOLOv10-B has 46\% less latency and 25\% fewer parameters for the same performance.

UPDATES 🔥 - 2024/05/26: Thanks to CVHub520 for the integration into X-AnyLabeling! - 2024/05/25: Add Transformers.js demo and onnx weights(yolov10n/s/m/b/l/x). Thanks to xenova! - 2024/05/25: Add colab demo, HuggingFace Demo, and HuggingFace Model Page. Thanks to SkalskiP and kadirnar!

Performance

COCO | 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 |

Installation

conda virtual environment is recommended.

conda create -n yolov10 python=3.9
conda activate yolov10
pip install -r requirements.txt
pip install -e .

Validation

yolov10n.pt yolov10s.pt yolov10m.pt yolov10b.pt yolov10l.pt yolov10x.pt

yolo val model=yolov10n/s/m/b/l/x.pt data=coco.yaml batch=256

Training

yolo detect train data=coco.yaml model=yolov10n/s/m/b/l/x.yaml epochs=500 batch=256 imgsz=640 device=0,1,2,3,4,5,6,7

Prediction

yolo predict model=yolov10n/s/m/b/l/x.pt

Export

# End-to-End ONNX
yolo export model=yolov10n/s/m/b/l/x.pt format=onnx opset=13 simplify
# Predict with ONNX
yolo predict model=yolov10n/s/m/b/l/x.onnx

# End-to-End TensorRT
yolo export model=yolov10n/s/m/b/l/x.pt format=engine half=True simplify opset=13 workspace=16
# Or
trtexec --onnx=yolov10n/s/m/b/l/x.onnx --saveEngine=yolov10n/s/m/b/l/x.engine --fp16
# Predict with TensorRT
yolo predict model=yolov10n/s/m/b/l/x.engine

Acknowledgement

The code base is built with ultralytics and RT-DETR.

Thanks for the great implementations!

Citation

If our code or models help your work, please cite our paper:

@misc{wang2024yolov10,
      title={YOLOv10: Real-Time End-to-End Object Detection}, 
      author={Ao Wang and Hui Chen and Lihao Liu and Kai Chen and Zijia Lin and Jungong Han and Guiguang Ding},
      year={2024},
      eprint={2405.14458},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

Core symbols most depended-on inside this repo

append
called by 214
ultralytics/data/augment.py
info
called by 165
ultralytics/engine/model.py
get
called by 161
ultralytics/utils/__init__.py
to
called by 78
ultralytics/engine/results.py
cpu
called by 73
ultralytics/engine/results.py
tolist
called by 60
ultralytics/data/augment.py
numpy
called by 46
ultralytics/engine/results.py
colorstr
called by 45
ultralytics/utils/__init__.py

Shape

Method 1,131
Function 516
Class 246

Languages

Python100%
TypeScript1%

Modules by API surface

ultralytics/nn/modules/block.py115 symbols
ultralytics/utils/metrics.py92 symbols
ultralytics/data/augment.py71 symbols
ultralytics/utils/__init__.py66 symbols
ultralytics/engine/results.py61 symbols
ultralytics/nn/tasks.py57 symbols
ultralytics/nn/modules/conv.py47 symbols
tests/test_python.py46 symbols
ultralytics/utils/loss.py41 symbols
ultralytics/models/sam/modules/tiny_encoder.py41 symbols
ultralytics/utils/ops.py37 symbols
ultralytics/nn/modules/transformer.py37 symbols

Dependencies from manifests, versioned

PyYAML6.0.1 · 1×
matplotlib3.3.0 · 1×
onnx1.14.0 · 1×
onnxruntime1.15.1 · 1×
onnxruntime-gpu1.18.0 · 1×
onnxsim0.4.36 · 1×
opencv-python4.6.0 · 1×
pandas1.1.4 · 1×
pillow7.1.2 · 1×
py-cpuinfo
pycocotools2.0.7 · 1×

For agents

$ claude mcp add yolov10 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact