2021-08-15 03:17:51 +08:00
|
|
|
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
|
2021-12-19 22:19:04 +08:00
|
|
|
# COCO 2017 dataset http://cocodataset.org by Microsoft
|
2021-07-28 05:23:41 +08:00
|
|
|
# Example usage: python train.py --data coco.yaml
|
2021-07-26 20:23:43 +08:00
|
|
|
# parent
|
|
|
|
# ├── yolov5
|
|
|
|
# └── datasets
|
|
|
|
# └── coco ← downloads here
|
2020-05-30 08:04:54 +08:00
|
|
|
|
|
|
|
|
2021-06-25 07:25:03 +08:00
|
|
|
# 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, ..]
|
|
|
|
path: ../datasets/coco # dataset root dir
|
|
|
|
train: train2017.txt # train images (relative to 'path') 118287 images
|
2021-12-17 23:43:00 +08:00
|
|
|
val: val2017.txt # val images (relative to 'path') 5000 images
|
2021-06-25 07:25:03 +08:00
|
|
|
test: test-dev2017.txt # 20288 of 40670 images, submit to https://competitions.codalab.org/competitions/20794
|
2020-08-10 11:52:57 +08:00
|
|
|
|
2021-06-25 07:25:03 +08:00
|
|
|
# Classes
|
|
|
|
nc: 80 # number of classes
|
2021-07-29 05:35:14 +08:00
|
|
|
names: ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light',
|
|
|
|
'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow',
|
|
|
|
'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee',
|
|
|
|
'skis', 'snowboard', 'sports ball', 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard',
|
|
|
|
'tennis racket', 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple',
|
|
|
|
'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch',
|
|
|
|
'potted plant', 'bed', 'dining table', 'toilet', 'tv', 'laptop', 'mouse', 'remote', 'keyboard', 'cell phone',
|
|
|
|
'microwave', 'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear',
|
|
|
|
'hair drier', 'toothbrush'] # class names
|
2021-06-25 07:25:03 +08:00
|
|
|
|
|
|
|
|
|
|
|
# Download script/URL (optional)
|
|
|
|
download: |
|
|
|
|
from utils.general import download, Path
|
|
|
|
|
2022-03-23 08:19:37 +08:00
|
|
|
|
2021-06-25 07:25:03 +08:00
|
|
|
# Download labels
|
|
|
|
segments = False # segment or box labels
|
|
|
|
dir = Path(yaml['path']) # dataset root dir
|
|
|
|
url = 'https://github.com/ultralytics/yolov5/releases/download/v1.0/'
|
|
|
|
urls = [url + ('coco2017labels-segments.zip' if segments else 'coco2017labels.zip')] # labels
|
|
|
|
download(urls, dir=dir.parent)
|
2020-05-30 08:04:54 +08:00
|
|
|
|
2021-06-25 07:25:03 +08:00
|
|
|
# Download data
|
|
|
|
urls = ['http://images.cocodataset.org/zips/train2017.zip', # 19G, 118k images
|
|
|
|
'http://images.cocodataset.org/zips/val2017.zip', # 1G, 5k images
|
|
|
|
'http://images.cocodataset.org/zips/test2017.zip'] # 7G, 41k images (optional)
|
|
|
|
download(urls, dir=dir / 'images', threads=3)
|