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 db0bdd64752187900ba46663ec66a249d79c3814..0900a935782751f02eda9c1ae5690d3932b2e6fc 100644 --- a/ppdet/utils/download.py +++ b/ppdet/utils/download.py @@ -195,6 +195,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