コード例 #1
0
ファイル: extractor.py プロジェクト: openvinotoolkit/datumaro
    def detect(
        cls,
        context: FormatDetectionContext,
    ) -> Optional[FormatDetectionConfidence]:
        if not cls.find_sources_with_params(context.root_path):
            context.fail("specific requirement information unavailable")

        return FormatDetectionConfidence.LOW
コード例 #2
0
 def detect(cls, context: FormatDetectionContext) -> None:
     try:
         next(
             find_files(context.root_path, VIDEO_EXTENSIONS,
                        recursive=True))
         return FormatDetectionConfidence.LOW
     except StopIteration:
         context.fail("No video files found in '%s'. "
                      "Checked extensions: %s" %
                      (context.root_path, ', '.join(VIDEO_EXTENSIONS)))