Implementasi resmi PyTorch dari YOLOv10 . NeuroIPS 2024.
Perbandingan dengan yang lain dalam hal trade-off akurasi latensi (kiri) dan akurasi ukuran (kanan).
YOLOv10: Deteksi Objek End-to-End Secara Real-Time.
Ao Wang, Hui Chen, Lihao Liu, Kai Chen, Zijia Lin, Jungong Han, dan Guiguang Ding
cv2
dan cv3
yang tidak perlu di v10Detect
dijalankan selama inferensi.KELAPA
Model | Ukuran Tes | #Param | FLOP | AP val | Latensi |
---|---|---|---|---|---|
YOLOv10-N | 640 | 2,3 juta | 6.7G | 38,5% | 1,84 md |
YOLOv10-S | 640 | 7,2 juta | 21.6G | 46,3% | 2,49 md |
YOLOv10-M | 640 | 15,4M | 59.1G | 51,1% | 4,74 md |
YOLOv10-B | 640 | 19,1 juta | 92.0G | 52,5% | 5,74 md |
YOLOv10-L | 640 | 24,4M | 120.3G | 53,2% | 7,28 md |
YOLOv10-X | 640 | 29,5 juta | 160.4G | 54,4% | 10,70 md |
lingkungan virtual conda
direkomendasikan.
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
Atau
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
Atau
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 )
Secara opsional, Anda dapat mendorong model yang telah Anda sesuaikan ke hub Hugging Face sebagai model publik atau pribadi:
# 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 )
Perhatikan bahwa ambang batas keyakinan yang lebih kecil dapat diatur untuk mendeteksi objek atau objek yang lebih kecil di kejauhan. Silakan lihat di sini untuk detailnya.
yolo predict model=jameslahm/yolov10{n/s/m/b/l/x}
Atau
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
Atau
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 (...)
Basis kode dibangun dengan ultralytics dan RT-DETR.
Terima kasih atas implementasinya yang luar biasa!
Jika kode atau model kami membantu pekerjaan Anda, harap kutip makalah kami:
@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 }
}