datumaro
datumaro copied to clipboard
Can't import a COCO Dataset
I have one image and one annotation file that I am trying to import using datumaro but I am getting an error:
could't match this file with any of these tasks: coco_instances,coco_person_keypoints ...
My code is: `from datumaro import Dataset
dataset = Dataset.import_from("/home/dataset", format="coco")
dataset `
The dataset folder is structured as follows: home ----dataset --------Images ------------DJI_20210901143844_0969_02_02.png --------Annotations ------------DJI_20210901143844_0969_02_02.json
I am getting this error:
`--------------------------------------------------------------------------- DatasetNotFoundError Traceback (most recent call last) Cell In[10], line 13 8 ids += [item.id] 10 return ids ---> 13 dataset = Dataset.import_from("/home/naro/data/RumexV0/Test2", format="coco") 14 subset = "default" 15 ids = get_ids(dataset, subset)
File ~/.conda/envs/images/lib/python3.10/site-packages/datumaro/components/dataset.py:832, in Dataset.import_from(cls, path, format, env, progress_reporter, error_policy, **kwargs) 829 importer = env.make_importer(format) 830 with logging_disabled(log.INFO): 831 detected_sources = ( --> 832 importer(path, stream=cls._stream, **kwargs) 833 if importer.can_stream 834 else importer(path, **kwargs) 835 ) 836 extractor_merger = importer.get_extractor_merger() 837 elif format in env.extractors:
File ~/.conda/envs/images/lib/python3.10/site-packages/datumaro/plugins/data_formats/coco/importer.py:78, in CocoImporter.call(self, path, stream, **extra_params) 75 subsets = self.find_sources(path) 77 if len(subsets) == 0: ---> 78 raise DatasetNotFoundError(path, self.NAME) 80 # TODO: should be removed when proper label merging is implemented ... (...) 86 CocoTask.stuff, 87 }
DatasetNotFoundError: Failed to find dataset 'coco' at '/home/dataset' `
Attached the json file and the image: DJI_20210901143828_0957_02_02.json (I can't upload the image because it's more than 10 MB)