Skip to main content

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 Hugging Face Spaces Hugging Face Spaces Transformers.js Demo LearnOpenCV Openbayes 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.

Notes

  • 2024/05/31: Please use the exported format for benchmark. In the non-exported format, e.g., pytorch, the speed of YOLOv10 is biased because the unnecessary cv2 and cv3 operations in the v10Detect are executed during inference.
  • 2024/05/30: We provide some clarifications and suggestions for detecting smaller objects or objects in the distance with YOLOv10. Thanks to SkalskiP!
  • 2024/05/27: We have updated the checkpoints with class names, for ease of use.

UPDATES 🔥

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 .

Demo

python app.py
# Please visit http://127.0.0.1:7860

Validation

yolov10n yolov10s yolov10m yolov10b yolov10l yolov10x

yolo val model=jameslahm/yolov10{n/s/m/b/l/x} data=coco.yaml batch=256

Or

from ultralytics import YOLOv10

model = YOLOv10.from_pretrained('jameslahm/yolov10{n/s/m/b/l/x}')
# or
# wget https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10{n/s/m/b/l/x}.pt
model = YOLOv10('yolov10{n/s/m/b/l/x}.pt')

model.val(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

Or

from ultralytics import YOLOv10

model = YOLOv10()
# If you want to finetune the model with pretrained weights, you could load the 
# pretrained weights like below
# model = YOLOv10.from_pretrained('jameslahm/yolov10{n/s/m/b/l/x}')
# or
# wget https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10{n/s/m/b/l/x}.pt
# model = YOLOv10('yolov10{n/s/m/b/l/x}.pt')

model.train(data='coco.yaml', epochs=500, batch=256, imgsz=640)

Push to hub to 🤗

Optionally, you can push your fine-tuned model to the Hugging Face hub as a public or private model:

# let's say you have fine-tuned a model for crop detection
model.push_to_hub("<your-hf-username-or-organization/yolov10-finetuned-crop-detection")

# you can also pass `private=True` if you don't want everyone to see your model
model.push_to_hub("<your-hf-username-or-organization/yolov10-finetuned-crop-detection", private=True)

Prediction

Note that a smaller confidence threshold can be set to detect smaller objects or objects in the distance. Please refer to here for details.

yolo predict model=jameslahm/yolov10{n/s/m/b/l/x}

Or

from ultralytics import YOLOv10

model = YOLOv10.from_pretrained('jameslahm/yolov10{n/s/m/b/l/x}')
# or
# wget https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10{n/s/m/b/l/x}.pt
model = YOLOv10('yolov10{n/s/m/b/l/x}.pt')

model.predict()

Export

# End-to-End ONNX
yolo export model=jameslahm/yolov10{n/s/m/b/l/x} 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=jameslahm/yolov10{n/s/m/b/l/x} 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

Or

from ultralytics import YOLOv10

model = YOLOv10.from_pretrained('jameslahm/yolov10{n/s/m/b/l/x}')
# or
# wget https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10{n/s/m/b/l/x}.pt
model = YOLOv10('yolov10{n/s/m/b/l/x}.pt')

model.export(...)

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:

@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}
}

Metadata

Release files for ultralytics-yolov10-rknn 8.1.34

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ultralytics-yolov10-rknn 8.1.34
File Size Uploaded
ultralytics_yolov10_rknn-8.1.34.tar.gz 637.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ultralytics-yolov10-rknn 8.1.34
File Interpreter ABI Platform
ultralytics_yolov10_rknn-8.1.34-py3-none-any.whl Python 3 none any Details

Total release size: 1.4 MB

Release files / ultralytics_yolov10_rknn-8.1.34.tar.gz

Download URL ultralytics_yolov10_rknn-8.1.34.tar.gz
Size 637.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e78f26ead8a62ba43b624b313c1e56cc9439512a9f689a963873224a1ebd8473
BLAKE2b-256 checksum
How to use checksums
1694b289df61dee6916cf5f245d0d04873138554d4c56f165283690c744a83d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / ultralytics_yolov10_rknn-8.1.34-py3-none-any.whl

Download URL ultralytics_yolov10_rknn-8.1.34-py3-none-any.whl
Size 732.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b75285650d27b2269402526b88caf95674149c6168919cb046dcbedba70cf70a
BLAKE2b-256 checksum
How to use checksums
504d89ec8968372f1f3316d4de0e8f6812ad62890f1954a415ee8edeae5f9ec9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

8.1.34 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page