Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

GlobalWheat2020.yaml 1.8 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
  1. # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
  2. # Global Wheat 2020 dataset http://www.global-wheat.com/
  3. # Example usage: python train.py --data GlobalWheat2020.yaml
  4. # parent
  5. # ├── yolov5
  6. # └── datasets
  7. # └── GlobalWheat2020 ← 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/GlobalWheat2020 # dataset root dir
  10. train: # train images (relative to 'path') 3422 images
  11. - images/arvalis_1
  12. - images/arvalis_2
  13. - images/arvalis_3
  14. - images/ethz_1
  15. - images/rres_1
  16. - images/inrae_1
  17. - images/usask_1
  18. val: # val images (relative to 'path') 748 images (WARNING: train set contains ethz_1)
  19. - images/ethz_1
  20. test: # test images (optional) 1276 images
  21. - images/utokyo_1
  22. - images/utokyo_2
  23. - images/nau_1
  24. - images/uq_1
  25. # Classes
  26. nc: 1 # number of classes
  27. names: ['wheat_head'] # class names
  28. # Download script/URL (optional) ---------------------------------------------------------------------------------------
  29. download: |
  30. from utils.general import download, Path
  31. # Download
  32. dir = Path(yaml['path']) # dataset root dir
  33. urls = ['https://zenodo.org/record/4298502/files/global-wheat-codalab-official.zip',
  34. 'https://github.com/ultralytics/yolov5/releases/download/v1.0/GlobalWheat2020_labels.zip']
  35. download(urls, dir=dir)
  36. # Make Directories
  37. for p in 'annotations', 'images', 'labels':
  38. (dir / p).mkdir(parents=True, exist_ok=True)
  39. # Move
  40. for p in 'arvalis_1', 'arvalis_2', 'arvalis_3', 'ethz_1', 'rres_1', 'inrae_1', 'usask_1', \
  41. 'utokyo_1', 'utokyo_2', 'nau_1', 'uq_1':
  42. (dir / p).rename(dir / 'images' / p) # move to /images
  43. f = (dir / p).with_suffix('.json') # json file
  44. if f.exists():
  45. f.rename((dir / 'annotations' / p).with_suffix('.json')) # move to /annotations
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...