def detect(cls, context: FormatDetectionContext) -> None: with context.require_any(): for prefix in (VggFace2Path.BBOXES_FILE, VggFace2Path.LANDMARKS_FILE): with context.alternative(): context.require_file( f'{VggFace2Path.ANNOTATION_DIR}/{prefix}*.csv')
def detect(cls, context: FormatDetectionContext): with context.require_any(): for image_dir in MarsPath.IMAGE_DIR_PATTERNS: with context.alternative(): context.require_file('/'.join([ MarsPath.SUBSET_DIR_PATTERN, image_dir, image_dir + MarsPath.IMAGE_NAME_POSTFIX ]))
def detect(cls, context: FormatDetectionContext) -> None: # The `voc` format is inherently ambiguous with `voc_classification`, # `voc_detection`, etc. To remove the ambiguity (and thus make it # possible to use autodetection with the VOC datasets), disable # autodetection for the single-task formats. if len(cls._TASKS) == 1: context.raise_unsupported() with context.require_any(): task_dirs = {task_dir for _, task_dir in cls._TASKS.values()} for task_dir in sorted(task_dirs): with context.alternative(): context.require_file( osp.join(VocPath.SUBSETS_DIR, task_dir, '*.txt'))
def detect( cls, context: FormatDetectionContext, ) -> FormatDetectionConfidence: # The `coco` format is inherently ambiguous with `coco_instances`, # `coco_stuff`, etc. To remove the ambiguity (and thus make it possible # to use autodetection with the COCO dataset), disable autodetection # for the single-task formats. if len(cls._TASKS) == 1: context.raise_unsupported() with context.require_any(): for task in cls._TASKS.keys(): with context.alternative(): context.require_file(f'annotations/{task.name}_*.json')
def detect(cls, context: FormatDetectionContext) -> None: with context.require_any(): for prefix in (SynthiaPath.IMAGES_DIR, SynthiaPath.LABELS_SEGM_DIR, SynthiaPath.SEMANTIC_SEGM_DIR): with context.alternative(): context.require_file(f'{prefix}/**/*.png')
def detect(cls, context: FormatDetectionContext) -> None: with context.require_any(): for pattern in cls.POSSIBLE_ANNOTATION_PATTERNS: with context.alternative(): context.require_file( f'{OpenImagesPath.ANNOTATIONS_DIR}/{pattern}')