From fc4c771acbf0a2381c6d319719bdca53223555fe Mon Sep 17 00:00:00 2001 From: Konstantin Gulin <66528950+KSGulin@users.noreply.github.com> Date: Thu, 23 Jun 2022 15:14:57 +0100 Subject: [PATCH] Revert "[Yolov5] Update in yaml dataset scripts (#869)" (#910) (#911) --- src/sparseml/yolov5/data/Argoverse.yaml | 2 +- src/sparseml/yolov5/data/GlobalWheat2020.yaml | 5 ++--- src/sparseml/yolov5/data/Objects365.yaml | 5 ++--- src/sparseml/yolov5/data/SKU-110K.yaml | 5 ++--- src/sparseml/yolov5/data/VOC.yaml | 5 ++--- src/sparseml/yolov5/data/VisDrone.yaml | 3 +-- src/sparseml/yolov5/data/coco.yaml | 5 ++--- src/sparseml/yolov5/data/xView.yaml | 3 +-- 8 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/sparseml/yolov5/data/Argoverse.yaml b/src/sparseml/yolov5/data/Argoverse.yaml index 994bf0ec86c..8b8c311e172 100644 --- a/src/sparseml/yolov5/data/Argoverse.yaml +++ b/src/sparseml/yolov5/data/Argoverse.yaml @@ -56,7 +56,7 @@ download: | # Download - dir = Path('src/sparseml/yolov5/datasets/Argoverse') # dataset root dir + dir = Path('datasets/Argoverse') # dataset root dir urls = ['https://argoverse-hd.s3.us-east-2.amazonaws.com/Argoverse-HD-Full.zip'] download(urls, dir=dir, delete=False) diff --git a/src/sparseml/yolov5/data/GlobalWheat2020.yaml b/src/sparseml/yolov5/data/GlobalWheat2020.yaml index 8f1d6069da3..e6209747de5 100644 --- a/src/sparseml/yolov5/data/GlobalWheat2020.yaml +++ b/src/sparseml/yolov5/data/GlobalWheat2020.yaml @@ -32,12 +32,11 @@ names: ['wheat_head'] # class names # Download script/URL (optional) --------------------------------------------------------------------------------------- download: | - from utils.general import download, Path, os + from utils.general import download, Path # Download - root_path = os.path.join("src", "sparseml", "yolov5") - dir = Path(os.path.join(root_path, yaml['path'])) # dataset root dir + dir = Path(yaml['path']) # dataset root dir urls = ['https://zenodo.org/record/4298502/files/global-wheat-codalab-official.zip', 'https://github.com/ultralytics/yolov5/releases/download/v1.0/GlobalWheat2020_labels.zip'] download(urls, dir=dir) diff --git a/src/sparseml/yolov5/data/Objects365.yaml b/src/sparseml/yolov5/data/Objects365.yaml index 28c8bcff6f6..d79a280408a 100644 --- a/src/sparseml/yolov5/data/Objects365.yaml +++ b/src/sparseml/yolov5/data/Objects365.yaml @@ -63,12 +63,11 @@ download: | from pycocotools.coco import COCO from tqdm import tqdm - from utils.general import Path, download, np, xyxy2xywhn, os + from utils.general import Path, download, np, xyxy2xywhn # Make Directories - root_path = os.path.join("src", "sparseml", "yolov5") - dir = Path(os.path.join(root_path, yaml['path'])) # dataset root dir + dir = Path(yaml['path']) # dataset root dir for p in 'images', 'labels': (dir / p).mkdir(parents=True, exist_ok=True) for q in 'train', 'val': diff --git a/src/sparseml/yolov5/data/SKU-110K.yaml b/src/sparseml/yolov5/data/SKU-110K.yaml index 13cc79e12ca..53b57f9a300 100644 --- a/src/sparseml/yolov5/data/SKU-110K.yaml +++ b/src/sparseml/yolov5/data/SKU-110K.yaml @@ -22,12 +22,11 @@ names: ['object'] # class names download: | import shutil from tqdm import tqdm - from utils.general import np, pd, Path, download, xyxy2xywh, os + from utils.general import np, pd, Path, download, xyxy2xywh # Download - root_path = os.path.join("src", "sparseml", "yolov5") - dir = Path(os.path.join(root_path, yaml['path'])) # dataset root dirr + dir = Path(yaml['path']) # dataset root dir parent = Path(dir.parent) # download dir urls = ['http://trax-geometry.s3.amazonaws.com/cvpr_challenge/SKU110K_fixed.tar.gz'] download(urls, dir=parent, delete=False) diff --git a/src/sparseml/yolov5/data/VOC.yaml b/src/sparseml/yolov5/data/VOC.yaml index 0e52be338a5..23e941d9d3c 100644 --- a/src/sparseml/yolov5/data/VOC.yaml +++ b/src/sparseml/yolov5/data/VOC.yaml @@ -30,7 +30,7 @@ download: | import xml.etree.ElementTree as ET from tqdm import tqdm - from utils.general import download, Path, os + from utils.general import download, Path def convert_label(path, lb_path, year, image_id): @@ -57,8 +57,7 @@ download: | # Download - root_path = os.path.join("src", "sparseml", "yolov5") - dir = Path(os.path.join(root_path, yaml['path'])) # dataset root dirr + dir = Path(yaml['path']) # dataset root dir url = 'https://github.com/ultralytics/yolov5/releases/download/v1.0/' urls = [url + 'VOCtrainval_06-Nov-2007.zip', # 446MB, 5012 images url + 'VOCtest_06-Nov-2007.zip', # 438MB, 4953 images diff --git a/src/sparseml/yolov5/data/VisDrone.yaml b/src/sparseml/yolov5/data/VisDrone.yaml index 645a24aff6f..07e63271171 100644 --- a/src/sparseml/yolov5/data/VisDrone.yaml +++ b/src/sparseml/yolov5/data/VisDrone.yaml @@ -49,8 +49,7 @@ download: | # Download - root_path = os.path.join("src", "sparseml", "yolov5") - dir = Path(os.path.join(root_path, yaml['path'])) # dataset root dirr + dir = Path(yaml['path']) # dataset root dir urls = ['https://github.com/ultralytics/yolov5/releases/download/v1.0/VisDrone2019-DET-train.zip', 'https://github.com/ultralytics/yolov5/releases/download/v1.0/VisDrone2019-DET-val.zip', 'https://github.com/ultralytics/yolov5/releases/download/v1.0/VisDrone2019-DET-test-dev.zip', diff --git a/src/sparseml/yolov5/data/coco.yaml b/src/sparseml/yolov5/data/coco.yaml index 923253026b4..bf78151d016 100644 --- a/src/sparseml/yolov5/data/coco.yaml +++ b/src/sparseml/yolov5/data/coco.yaml @@ -28,13 +28,12 @@ names: ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 't # Download script/URL (optional) download: | - from utils.general import download, Path, os + from utils.general import download, Path # Download labels - root_path = os.path.join("src", "sparseml", "yolov5") segments = False # segment or box labels - dir = Path(os.path.join(root_path, yaml['path'])) # dataset root dir + dir = Path(yaml['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.parent) diff --git a/src/sparseml/yolov5/data/xView.yaml b/src/sparseml/yolov5/data/xView.yaml index 6a7669472eb..217736f1dc8 100644 --- a/src/sparseml/yolov5/data/xView.yaml +++ b/src/sparseml/yolov5/data/xView.yaml @@ -83,8 +83,7 @@ download: | # Download manually from https://challenge.xviewdataset.org - root_path = os.path.join("src", "sparseml", "yolov5") - dir = Path(os.path.join(root_path, yaml['path'])) # dataset root dirr + dir = Path(yaml['path']) # dataset root dir # urls = ['https://d307kc0mrhucc3.cloudfront.net/train_labels.zip', # train labels # 'https://d307kc0mrhucc3.cloudfront.net/train_images.zip', # 15G, 847 train images # 'https://d307kc0mrhucc3.cloudfront.net/val_images.zip'] # 5G, 282 val images (no labels)