Skip to content

Commit

Permalink
Update detect function
Browse files Browse the repository at this point in the history
  • Loading branch information
sooahleex committed Sep 22, 2024
1 parent 2372cd1 commit c253abe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/datumaro/plugins/data_formats/kitti/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class KittiDetectionImporter(KittiImporter):
@classmethod
def detect(cls, context: FormatDetectionContext) -> FormatDetectionConfidence:
# left color camera label files
context.require_file(f"**/label_2/*{cls._ANNO_EXT}")
context.require_file(f"**/label_2/*_*.{cls._ANNO_EXT}")
return cls.DETECT_CONFIDENCE

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion src/datumaro/plugins/data_formats/kitti_3d/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


class Kitti3dPath:
PCD_DIR = osp.join("velodyne_points", "data")
PCD_DIR = osp.join("velodyne")
IMAGE_DIR = "image_2"
LABEL_DIR = "label_2"
CALIB_DIR = "calib"
6 changes: 2 additions & 4 deletions src/datumaro/plugins/data_formats/kitti_3d/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ class Kitti3dImporter(Importer):

@classmethod
def detect(cls, context: FormatDetectionContext) -> FormatDetectionConfidence:
with context.require_any():
with context.alternative():
cls._check_ann_file(context.require_file(f"{Kitti3dPath.LABEL_DIR}/*.txt"), context)

context.require_file(f"{Kitti3dPath.PCD_DIR}/*.bin")
cls._check_ann_file(context.require_file(f"{Kitti3dPath.LABEL_DIR}/*.txt"), context)
return FormatDetectionConfidence.MEDIUM

@classmethod
Expand Down

0 comments on commit c253abe

Please sign in to comment.