Skip to content

Commit

Permalink
Update find_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
sooahleex committed Sep 23, 2024
1 parent e80ec8e commit f5182af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/datumaro/plugins/data_formats/kitti_3d/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ def __init__(
subset: Optional[str] = None,
ctx: Optional[ImportContext] = None,
):
assert osp.isfile(path), path
assert osp.isdir(path), path
super().__init__(subset=subset, ctx=ctx)

self._path = path
self._categories = {AnnotationType.label: LabelCategories()}
self._items = self._load()
self._items = self._load_items()

def _load(self) -> List[DatasetItem]:
def _load_items(self) -> List[DatasetItem]:
items = []
image_dir = osp.join(self._path, Kitti3dPath.IMAGE_DIR)
image_path_by_id = {
Expand Down
4 changes: 4 additions & 0 deletions src/datumaro/plugins/data_formats/kitti_3d/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ def _check_ann_file(cls, fpath: str, context: FormatDetectionContext) -> bool:
@classmethod
def get_file_extensions(cls) -> List[str]:
return [cls._ANNO_EXT]

@classmethod
def find_sources(cls, path):
return [{"url": path, "format": "kitti3d"}]

0 comments on commit f5182af

Please sign in to comment.