coco.yaml 2.6 KB

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