TensorRT转化代码
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

před 10 měsíci
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # YOLOv5 🚀 by Ultralytics https://ultralytics.com, licensed under GNU GPL v3.0
  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