diff --git a/src/bob/pad/face/database/database.py b/src/bob/pad/face/database/database.py index 0c5d53d774801f8b7826c35cd16958a6503fb7c5..2175d74f06245b3d789d83eaf18b35eb38069688 100644 --- a/src/bob/pad/face/database/database.py +++ b/src/bob/pad/face/database/database.py @@ -43,9 +43,16 @@ def delayed_video_load( path = sample.filename if not keep_extension_for_annotation: path = os.path.splitext(sample.filename)[0] + + # Check if the annotation directory is a local directory or a tar.gz + if os.path.isdir(annotation_directory): + file_name = os.path.join(annotation_directory, path + ".json") + else: + file_name = f"{annotation_directory}:{path}.json" + delayed_annotations = partial( read_annotation_file, - file_name=f"{annotation_directory}:{path}.json", + file_name=file_name, annotation_type="json", ) delayed_attributes = {"annotations": delayed_annotations}