You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 line
2.3KB

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