diff --git a/ppdet/data/source/dataset.py b/ppdet/data/source/dataset.py index b0d8726ed1dac7e6202840b404d8ce9694d80655..1bef548e696764964608ade67b373a1c19c84a96 100644 --- a/ppdet/data/source/dataset.py +++ b/ppdet/data/source/dataset.py @@ -149,7 +149,12 @@ class ImageFolder(DetDataset): self.sample_num = sample_num def check_or_download_dataset(self): - return + if self.dataset_dir: + # NOTE: ImageFolder is only used for prediction, in + # infer mode, image_dir is set by set_images + # so we only check anno_path here + self.dataset_dir = get_dataset_path(self.dataset_dir, + self.anno_path, None) def parse_dataset(self, ): if not self.roidbs: diff --git a/ppdet/utils/download.py b/ppdet/utils/download.py index 4f9bfc2ce94465db082f62f1881519441a05084b..00870b82da5291cd08a2ad59b12c9f12513c8b0f 100644 --- a/ppdet/utils/download.py +++ b/ppdet/utils/download.py @@ -192,6 +192,10 @@ def get_dataset_path(path, annotation, image_dir): "Please apply and download the dataset following docs/tutorials/PrepareMOTDataSet.md". format(name)) + if name == "spine_coco": + if _dataset_exists(data_dir, annotation, image_dir): + return data_dir + # For voc, only check dir VOCdevkit/VOC2012, VOCdevkit/VOC2007 if name in ['voc', 'fruit', 'roadsign_voc']: exists = True