Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,77 @@
|
|
1 |
-
---
|
2 |
-
license: agpl-3.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: agpl-3.0
|
3 |
+
tags:
|
4 |
+
- object-detection
|
5 |
+
- computer-vision
|
6 |
+
- yolov10
|
7 |
+
- pypi
|
8 |
+
datasets:
|
9 |
+
- detection-datasets/coco
|
10 |
+
---
|
11 |
+
|
12 |
+
### Model Description
|
13 |
+
[YOLOv10: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors](https://arxiv.org/abs/2405.14458v1)
|
14 |
+
|
15 |
+
[Paper Repo: Implementation of paper - YOLOv10](https://github.com/THU-MIG/yolov10)
|
16 |
+
|
17 |
+
### Installation
|
18 |
+
```
|
19 |
+
pip install supervision git+https://github.com/THU-MIG/yolov10.git
|
20 |
+
```
|
21 |
+
|
22 |
+
### Yolov10 Inference
|
23 |
+
```python
|
24 |
+
from ultralytics import YOLOv10
|
25 |
+
import supervision as sv
|
26 |
+
import cv2
|
27 |
+
|
28 |
+
MODEL_PATH = 'yolov10n.pt'
|
29 |
+
IMAGE_PATH = 'dog.jpeg'
|
30 |
+
|
31 |
+
model = YOLOv10(MODEL_PATH)
|
32 |
+
image = cv2.imread(IMAGE_PATH)
|
33 |
+
results = model(source=image, conf=0.25, verbose=False)[0]
|
34 |
+
detections = sv.Detections.from_ultralytics(results)
|
35 |
+
box_annotator = sv.BoxAnnotator()
|
36 |
+
|
37 |
+
category_dict = {
|
38 |
+
0: 'person', 1: 'bicycle', 2: 'car', 3: 'motorcycle', 4: 'airplane', 5: 'bus',
|
39 |
+
6: 'train', 7: 'truck', 8: 'boat', 9: 'traffic light', 10: 'fire hydrant',
|
40 |
+
11: 'stop sign', 12: 'parking meter', 13: 'bench', 14: 'bird', 15: 'cat',
|
41 |
+
16: 'dog', 17: 'horse', 18: 'sheep', 19: 'cow', 20: 'elephant', 21: 'bear',
|
42 |
+
22: 'zebra', 23: 'giraffe', 24: 'backpack', 25: 'umbrella', 26: 'handbag',
|
43 |
+
27: 'tie', 28: 'suitcase', 29: 'frisbee', 30: 'skis', 31: 'snowboard',
|
44 |
+
32: 'sports ball', 33: 'kite', 34: 'baseball bat', 35: 'baseball glove',
|
45 |
+
36: 'skateboard', 37: 'surfboard', 38: 'tennis racket', 39: 'bottle',
|
46 |
+
40: 'wine glass', 41: 'cup', 42: 'fork', 43: 'knife', 44: 'spoon', 45: 'bowl',
|
47 |
+
46: 'banana', 47: 'apple', 48: 'sandwich', 49: 'orange', 50: 'broccoli',
|
48 |
+
51: 'carrot', 52: 'hot dog', 53: 'pizza', 54: 'donut', 55: 'cake',
|
49 |
+
56: 'chair', 57: 'couch', 58: 'potted plant', 59: 'bed', 60: 'dining table',
|
50 |
+
61: 'toilet', 62: 'tv', 63: 'laptop', 64: 'mouse', 65: 'remote', 66: 'keyboard',
|
51 |
+
67: 'cell phone', 68: 'microwave', 69: 'oven', 70: 'toaster', 71: 'sink',
|
52 |
+
72: 'refrigerator', 73: 'book', 74: 'clock', 75: 'vase', 76: 'scissors',
|
53 |
+
77: 'teddy bear', 78: 'hair drier', 79: 'toothbrush'
|
54 |
+
}
|
55 |
+
|
56 |
+
labels = [
|
57 |
+
f"{category_dict[class_id]} {confidence:.2f}"
|
58 |
+
for class_id, confidence in zip(detections.class_id, detections.confidence)
|
59 |
+
]
|
60 |
+
annotated_image = box_annotator.annotate(
|
61 |
+
image.copy(), detections=detections, labels=labels
|
62 |
+
)
|
63 |
+
|
64 |
+
cv2.imwrite('annotated_dog.jpeg', annotated_image)
|
65 |
+
```
|
66 |
+
|
67 |
+
### BibTeX Entry and Citation Info
|
68 |
+
```
|
69 |
+
@misc{wang2024yolov10,
|
70 |
+
title={YOLOv10: Real-Time End-to-End Object Detection},
|
71 |
+
author={Ao Wang and Hui Chen and Lihao Liu and Kai Chen and Zijia Lin and Jungong Han and Guiguang Ding},
|
72 |
+
year={2024},
|
73 |
+
eprint={2405.14458},
|
74 |
+
archivePrefix={arXiv},
|
75 |
+
primaryClass={cs.CV}
|
76 |
+
}
|
77 |
+
```
|