|
a |
|
b/data/coco.yaml |
|
|
1 |
# YOLOv5 🚀 by Ultralytics, AGPL-3.0 license |
|
|
2 |
# COCO 2017 dataset http://cocodataset.org by Microsoft |
|
|
3 |
# Example usage: python train.py --data coco.yaml |
|
|
4 |
# parent |
|
|
5 |
# ├── yolov5 |
|
|
6 |
# └── datasets |
|
|
7 |
# └── coco ← downloads here (20.1 GB) |
|
|
8 |
|
|
|
9 |
|
|
|
10 |
# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..] |
|
|
11 |
path: ../datasets/coco # dataset root dir |
|
|
12 |
train: train2017.txt # train images (relative to 'path') 118287 images |
|
|
13 |
val: val2017.txt # val images (relative to 'path') 5000 images |
|
|
14 |
test: test-dev2017.txt # 20288 of 40670 images, submit to https://competitions.codalab.org/competitions/20794 |
|
|
15 |
|
|
|
16 |
# Classes |
|
|
17 |
names: |
|
|
18 |
0: person |
|
|
19 |
1: bicycle |
|
|
20 |
2: car |
|
|
21 |
3: motorcycle |
|
|
22 |
4: airplane |
|
|
23 |
5: bus |
|
|
24 |
6: train |
|
|
25 |
7: truck |
|
|
26 |
8: boat |
|
|
27 |
9: traffic light |
|
|
28 |
10: fire hydrant |
|
|
29 |
11: stop sign |
|
|
30 |
12: parking meter |
|
|
31 |
13: bench |
|
|
32 |
14: bird |
|
|
33 |
15: cat |
|
|
34 |
16: dog |
|
|
35 |
17: horse |
|
|
36 |
18: sheep |
|
|
37 |
19: cow |
|
|
38 |
20: elephant |
|
|
39 |
21: bear |
|
|
40 |
22: zebra |
|
|
41 |
23: giraffe |
|
|
42 |
24: backpack |
|
|
43 |
25: umbrella |
|
|
44 |
26: handbag |
|
|
45 |
27: tie |
|
|
46 |
28: suitcase |
|
|
47 |
29: frisbee |
|
|
48 |
30: skis |
|
|
49 |
31: snowboard |
|
|
50 |
32: sports ball |
|
|
51 |
33: kite |
|
|
52 |
34: baseball bat |
|
|
53 |
35: baseball glove |
|
|
54 |
36: skateboard |
|
|
55 |
37: surfboard |
|
|
56 |
38: tennis racket |
|
|
57 |
39: bottle |
|
|
58 |
40: wine glass |
|
|
59 |
41: cup |
|
|
60 |
42: fork |
|
|
61 |
43: knife |
|
|
62 |
44: spoon |
|
|
63 |
45: bowl |
|
|
64 |
46: banana |
|
|
65 |
47: apple |
|
|
66 |
48: sandwich |
|
|
67 |
49: orange |
|
|
68 |
50: broccoli |
|
|
69 |
51: carrot |
|
|
70 |
52: hot dog |
|
|
71 |
53: pizza |
|
|
72 |
54: donut |
|
|
73 |
55: cake |
|
|
74 |
56: chair |
|
|
75 |
57: couch |
|
|
76 |
58: potted plant |
|
|
77 |
59: bed |
|
|
78 |
60: dining table |
|
|
79 |
61: toilet |
|
|
80 |
62: tv |
|
|
81 |
63: laptop |
|
|
82 |
64: mouse |
|
|
83 |
65: remote |
|
|
84 |
66: keyboard |
|
|
85 |
67: cell phone |
|
|
86 |
68: microwave |
|
|
87 |
69: oven |
|
|
88 |
70: toaster |
|
|
89 |
71: sink |
|
|
90 |
72: refrigerator |
|
|
91 |
73: book |
|
|
92 |
74: clock |
|
|
93 |
75: vase |
|
|
94 |
76: scissors |
|
|
95 |
77: teddy bear |
|
|
96 |
78: hair drier |
|
|
97 |
79: toothbrush |
|
|
98 |
|
|
|
99 |
|
|
|
100 |
# Download script/URL (optional) |
|
|
101 |
download: | |
|
|
102 |
from utils.general import download, Path |
|
|
103 |
|
|
|
104 |
|
|
|
105 |
# Download labels |
|
|
106 |
segments = False # segment or box labels |
|
|
107 |
dir = Path(yaml['path']) # dataset root dir |
|
|
108 |
url = 'https://github.com/ultralytics/yolov5/releases/download/v1.0/' |
|
|
109 |
urls = [url + ('coco2017labels-segments.zip' if segments else 'coco2017labels.zip')] # labels |
|
|
110 |
download(urls, dir=dir.parent) |
|
|
111 |
|
|
|
112 |
# Download data |
|
|
113 |
urls = ['http://images.cocodataset.org/zips/train2017.zip', # 19G, 118k images |
|
|
114 |
'http://images.cocodataset.org/zips/val2017.zip', # 1G, 5k images |
|
|
115 |
'http://images.cocodataset.org/zips/test2017.zip'] # 7G, 41k images (optional) |
|
|
116 |
download(urls, dir=dir / 'images', threads=3) |