From d52b5a3b71ecee4d60e036d41b99eaed07e6f09d Mon Sep 17 00:00:00 2001 From: fpaissan Date: Thu, 14 Dec 2023 13:51:12 +0100 Subject: [PATCH] fix download to specific location --- recipes/object_detection/cfg/data/coco.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/recipes/object_detection/cfg/data/coco.yaml b/recipes/object_detection/cfg/data/coco.yaml index 7507602..7784195 100644 --- a/recipes/object_detection/cfg/data/coco.yaml +++ b/recipes/object_detection/cfg/data/coco.yaml @@ -137,6 +137,7 @@ names: download: | from ultralytics.utils.downloads import download from pathlib import Path + import shutil # Download labels segments = True # segment or box labels @@ -144,8 +145,15 @@ download: | 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)