77import hashlib
88
99from ..logger import get_logger
10+ from ..constants import VALID_MEDIA_TYPES
1011
1112logger = get_logger (__name__ )
1213
@@ -46,7 +47,7 @@ class BenchmarkDatasetConfig:
4647 name : str
4748 path : str
4849 modality : str # "image", "video", or "audio"
49- media_type : str # "real", " synthetic", or "semisynthetic"
50+ media_type : str # image: real/ synthetic/semisynthetic; video also allows rendered
5051
5152 # Download parameters
5253 media_per_archive : int = 100
@@ -324,11 +325,14 @@ def validate_dataset_config(
324325 )
325326
326327 if "media_type" in config_dict :
327- valid_media_types = ["real" , "synthetic" , "semisynthetic" ]
328+ modality = config_dict .get ("modality" , "image" )
329+ valid_media_types = VALID_MEDIA_TYPES .get (
330+ modality , VALID_MEDIA_TYPES ["image" ]
331+ )
328332 if config_dict ["media_type" ] not in valid_media_types :
329333 errors .append (
330- f"Dataset '{ dataset_name } ': Invalid media_type '{ config_dict ['media_type' ]} '. "
331- f"Must be one of { valid_media_types } "
334+ f"Dataset '{ dataset_name } ': Invalid media_type '{ config_dict ['media_type' ]} ' "
335+ f"for modality ' { modality } '. Must be one of { sorted ( valid_media_types ) } "
332336 )
333337
334338 if "source" in config_dict :
@@ -609,7 +613,8 @@ def _load_modality_config(modality: str, custom_path: Optional[str] = None) -> l
609613 data = yaml .safe_load (f )
610614 return data .get ("datasets" , [])
611615
612- # Load from split real + synthetic configs and merge
616+ # Load from split real + synthetic configs and merge.
617+ # legacy_images.yaml / legacy_videos.yaml are bundled but not loaded here.
613618 SPLIT_CONFIGS = {
614619 "image" : ("real_images.yaml" , "synthetic_images.yaml" ),
615620 "video" : ("real_videos.yaml" , "synthetic_videos.yaml" ),
@@ -742,12 +747,13 @@ def get_benchmark_dataset_summary() -> Dict:
742747 summary = {
743748 "image" : {
744749 "total" : len (image_datasets ),
745- "active" : len (
746- [d for d in image_datasets if d .media_type in ["real" , "synthetic" ]]
747- ),
750+ "active" : len (image_datasets ),
748751 "synthetic" : len (
749752 [d for d in image_datasets if d .media_type == "synthetic" ]
750753 ),
754+ "semisynthetic" : len (
755+ [d for d in image_datasets if d .media_type == "semisynthetic" ]
756+ ),
751757 "real" : len ([d for d in image_datasets if d .media_type == "real" ]),
752758 "datasets" : [
753759 {"name" : d .name , "path" : d .path , "media_type" : d .media_type }
@@ -756,12 +762,16 @@ def get_benchmark_dataset_summary() -> Dict:
756762 },
757763 "video" : {
758764 "total" : len (video_datasets ),
759- "active" : len (
760- [d for d in video_datasets if d .media_type in ["real" , "synthetic" ]]
761- ),
765+ "active" : len (video_datasets ),
762766 "synthetic" : len (
763767 [d for d in video_datasets if d .media_type == "synthetic" ]
764768 ),
769+ "semisynthetic" : len (
770+ [d for d in video_datasets if d .media_type == "semisynthetic" ]
771+ ),
772+ "rendered" : len (
773+ [d for d in video_datasets if d .media_type == "rendered" ]
774+ ),
765775 "real" : len ([d for d in video_datasets if d .media_type == "real" ]),
766776 "datasets" : [
767777 {"name" : d .name , "path" : d .path , "media_type" : d .media_type }
0 commit comments