glenn-jocher commited on
Commit
487edd5
1 Parent(s): 258f4c6

Dataset autodownload fstring updates

Browse files
Files changed (2) hide show
  1. data/Argoverse.yaml +1 -1
  2. data/VOC.yaml +4 -4
data/Argoverse.yaml CHANGED
@@ -32,7 +32,7 @@ download: |
32
  for annot in tqdm(a['annotations'], desc=f"Converting {set} to YOLOv5 format..."):
33
  img_id = annot['image_id']
34
  img_name = a['images'][img_id]['name']
35
- img_label_name = img_name[:-3] + "txt"
36
 
37
  cls = annot['category_id'] # instance class id
38
  x_center, y_center, width, height = annot['bbox']
 
32
  for annot in tqdm(a['annotations'], desc=f"Converting {set} to YOLOv5 format..."):
33
  img_id = annot['image_id']
34
  img_name = a['images'][img_id]['name']
35
+ img_label_name = f'{img_name[:-3]}txt'
36
 
37
  cls = annot['category_id'] # instance class id
38
  x_center, y_center, width, height = annot['bbox']
data/VOC.yaml CHANGED
@@ -59,13 +59,13 @@ download: |
59
  # Download
60
  dir = Path(yaml['path']) # dataset root dir
61
  url = 'https://github.com/ultralytics/yolov5/releases/download/v1.0/'
62
- urls = [url + 'VOCtrainval_06-Nov-2007.zip', # 446MB, 5012 images
63
- url + 'VOCtest_06-Nov-2007.zip', # 438MB, 4953 images
64
- url + 'VOCtrainval_11-May-2012.zip'] # 1.95GB, 17126 images
65
  download(urls, dir=dir / 'images', delete=False, curl=True, threads=3)
66
 
67
  # Convert
68
- path = dir / f'images/VOCdevkit'
69
  for year, image_set in ('2012', 'train'), ('2012', 'val'), ('2007', 'train'), ('2007', 'val'), ('2007', 'test'):
70
  imgs_path = dir / 'images' / f'{image_set}{year}'
71
  lbs_path = dir / 'labels' / f'{image_set}{year}'
 
59
  # Download
60
  dir = Path(yaml['path']) # dataset root dir
61
  url = 'https://github.com/ultralytics/yolov5/releases/download/v1.0/'
62
+ urls = [f'{url}VOCtrainval_06-Nov-2007.zip', # 446MB, 5012 images
63
+ f'{url}VOCtest_06-Nov-2007.zip', # 438MB, 4953 images
64
+ f'{url}VOCtrainval_11-May-2012.zip'] # 1.95GB, 17126 images
65
  download(urls, dir=dir / 'images', delete=False, curl=True, threads=3)
66
 
67
  # Convert
68
+ path = dir / 'images/VOCdevkit'
69
  for year, image_set in ('2012', 'train'), ('2012', 'val'), ('2007', 'train'), ('2007', 'val'), ('2007', 'test'):
70
  imgs_path = dir / 'images' / f'{image_set}{year}'
71
  lbs_path = dir / 'labels' / f'{image_set}{year}'