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.

56 line
2.0KB

  1. # Global Wheat 2020 dataset http://www.global-wheat.com/
  2. # Train command: python train.py --data GlobalWheat2020.yaml
  3. # Default dataset location is next to YOLOv5:
  4. # /parent_folder
  5. # /datasets/GlobalWheat2020
  6. # /yolov5
  7. # train and val data as 1) directory: path/images/, 2) file: path/images.txt, or 3) list: [path1/images/, path2/images/]
  8. train: # 3422 images
  9. - ../datasets/GlobalWheat2020/images/arvalis_1
  10. - ../datasets/GlobalWheat2020/images/arvalis_2
  11. - ../datasets/GlobalWheat2020/images/arvalis_3
  12. - ../datasets/GlobalWheat2020/images/ethz_1
  13. - ../datasets/GlobalWheat2020/images/rres_1
  14. - ../datasets/GlobalWheat2020/images/inrae_1
  15. - ../datasets/GlobalWheat2020/images/usask_1
  16. val: # 748 images (WARNING: train set contains ethz_1)
  17. - ../datasets/GlobalWheat2020/images/ethz_1
  18. test: # 1276
  19. - ../datasets/GlobalWheat2020/images/utokyo_1
  20. - ../datasets/GlobalWheat2020/images/utokyo_2
  21. - ../datasets/GlobalWheat2020/images/nau_1
  22. - ../datasets/GlobalWheat2020/images/uq_1
  23. # number of classes
  24. nc: 1
  25. # class names
  26. names: [ 'wheat_head' ]
  27. # download command/URL (optional) --------------------------------------------------------------------------------------
  28. download: |
  29. from utils.general import download, Path
  30. # Download
  31. dir = Path('../datasets/GlobalWheat2020') # dataset directory
  32. urls = ['https://zenodo.org/record/4298502/files/global-wheat-codalab-official.zip',
  33. 'https://github.com/ultralytics/yolov5/releases/download/v1.0/GlobalWheat2020_labels.zip']
  34. download(urls, dir=dir)
  35. # Make Directories
  36. for p in 'annotations', 'images', 'labels':
  37. (dir / p).mkdir(parents=True, exist_ok=True)
  38. # Move
  39. for p in 'arvalis_1', 'arvalis_2', 'arvalis_3', 'ethz_1', 'rres_1', 'inrae_1', 'usask_1', \
  40. 'utokyo_1', 'utokyo_2', 'nau_1', 'uq_1':
  41. (dir / p).rename(dir / 'images' / p) # move to /images
  42. f = (dir / p).with_suffix('.json') # json file
  43. if f.exists():
  44. f.rename((dir / 'annotations' / p).with_suffix('.json')) # move to /annotations