約洛夫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 }
}