Skip to content

Commit

Permalink
fix download to specific location
Browse files Browse the repository at this point in the history
  • Loading branch information
fpaissan committed Dec 14, 2023
1 parent 41c4e78 commit d52b5a3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions recipes/object_detection/cfg/data/coco.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,23 @@ names:
download: |
from ultralytics.utils.downloads import download
from pathlib import Path
import shutil
# Download labels
segments = True # segment or box labels
dir = Path(data_cfg['path']) # dataset root dir
url = 'https://github.com/ultralytics/yolov5/releases/download/v1.0/'
urls = [url + ('coco2017labels-segments.zip' if segments else 'coco2017labels.zip')] # labels
download(urls, dir=dir)
extracted_folder_path = dir / 'coco'
shutil.copytree(extracted_folder_path, data_cfg['path'], dirs_exist_ok = True)
shutil.rmtree(extracted_folder_path)
# Download data
urls = ['http://images.cocodataset.org/zips/train2017.zip', # 19G, 118k images
'http://images.cocodataset.org/zips/val2017.zip', # 1G, 5k images
'http://images.cocodataset.org/zips/test2017.zip'] # 7G, 41k images (optional)
download(urls, dir=dir / 'images', threads=3)
extracted_folder_path = dir / 'coco'
shutil.copytree(extracted_folder_path, data_cfg['path'], dirs_exist_ok = True)
shutil.rmtree(extracted_folder_path)

0 comments on commit d52b5a3

Please sign in to comment.