约洛夫10
Update checkpoints with other attributes.
YOLOv10的官方 PyTorch 实现。 NeurIPS 2024。
在延迟精度(左)和大小精度(右)权衡方面与其他方案进行比较。
YOLOv10:实时端到端对象检测。
王傲、陈辉、刘立豪、陈凯、林子佳、韩军工、丁桂光
v10Detect
中不必要的cv2
和cv3
操作。可可
模型 | 测试尺寸 | #参数 | 失败次数 | AP值 | 延迟 |
---|---|---|---|---|---|
YOLOv10-N | 640 | 2.3M | 6.7G | 38.5% | 1.84毫秒 |
YOLOv10-S | 640 | 7.2M | 21.6G | 46.3% | 2.49毫秒 |
YOLOv10-M | 640 | 15.4M | 59.1G | 51.1% | 4.74毫秒 |
YOLOv10-B | 640 | 19.1M | 92.0G | 52.5% | 5.74毫秒 |
YOLOv10-L | 640 | 24.4M | 120.3G | 53.2% | 7.28毫秒 |
YOLOv10-X | 640 | 29.5M | 160.4G | 54.4% | 10.70毫秒 |
推荐使用conda
虚拟环境。
conda create -n yolov10 python=3.9
conda activate yolov10
pip install -r requirements.txt
pip install -e .
python app.py
# Please visit http://127.0.0.1:7860
yolov10n
yolov10s
yolov10m
yolov10b
yolov10l
yolov10x
yolo val model=jameslahm/yolov10{n/s/m/b/l/x} data=coco.yaml batch=256
或者
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 )
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
或者
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 )
或者,您可以将微调后的模型作为公共或私有模型推送到 Hugging Face 中心:
# let's say you have fine-tuned a model for crop detection
model . push_to_hub ( " )
# you can also pass `private=True` if you don't want everyone to see your model
model . push_to_hub ( " , private = True )
请注意,可以设置较小的置信度阈值来检测较小的物体或远处的物体。详情请参阅此处。
yolo predict model=jameslahm/yolov10{n/s/m/b/l/x}
或者
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 ()
# 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
或者
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 (...)
代码库是用 ultralytics 和 RT-DETR 构建的。
感谢您的出色实施!
如果我们的代码或模型对您的工作有帮助,请引用我们的论文:
@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 }
}