2525The factory supports two types of datasets:
2626 1. LeRobot datasets: Standard robot learning datasets loaded from HuggingFace
2727 repositories with configurable delta timestamps for temporal alignment.
28- 2. Grounding datasets: Vision-language grounding datasets (CLEVR, COCO-QA,
28+ 2. VQA datasets: Vision-language vqa datasets (CLEVR, COCO-QA,
2929 PIXMO, VSR, etc.) for multimodal learning tasks.
3030
3131Key Features:
3636 during dataset creation.
3737 - Imagenet stats override: Optionally replaces dataset statistics with
3838 ImageNet normalization statistics for camera features.
39- - Grounding dataset registration: Supports extensible grounding dataset
39+ - VQA dataset registration: Supports extensible vqa dataset
4040 registration through side-effect imports.
4141
4242Functions:
6868import torch
6969
7070# NOTE: Don't delete; imported for side effects.
71- import opentau .datasets .grounding .clevr # noqa: F401
72- import opentau .datasets .grounding .cocoqa # noqa: F401
73- import opentau .datasets .grounding .dummy # noqa: F401
74- import opentau .datasets .grounding .pixmo # noqa: F401
75- import opentau .datasets .grounding .vsr # noqa: F401
76- from opentau import available_grounding_datasets
71+ import opentau .datasets .vqa .clevr # noqa: F401
72+ import opentau .datasets .vqa .cocoqa # noqa: F401
73+ import opentau .datasets .vqa .dummy # noqa: F401
74+ import opentau .datasets .vqa .pixmo # noqa: F401
75+ import opentau .datasets .vqa .vsr # noqa: F401
76+ from opentau import available_vqa_datasets
7777from opentau .configs .default import DatasetConfig
7878from opentau .configs .train import TrainPipelineConfig
7979from opentau .datasets .dataset_mixture import WeightedDatasetMixture
@@ -169,23 +169,22 @@ def make_dataset(
169169 "episode_end_idx", "current_idx", "last_step", "episode_index", and "timestamp". Defaults to False.
170170
171171 Raises:
172- ValueError: If exactly one of `cfg.grounding ` and `cfg.repo_id` is not provided.
173- ValueError: If `cfg.grounding ` is not a supported grounding dataset.
172+ ValueError: If exactly one of `cfg.vqa ` and `cfg.repo_id` is not provided.
173+ ValueError: If `cfg.vqa ` is not a supported vqa dataset.
174174
175175 Returns:
176176 BaseDataset or Tuple[BaseDataset, BaseDataset]: A single dataset or a tuple of (train_dataset, val_dataset) if val_freq > 0.
177177 """
178178 image_transforms = ImageTransforms (cfg .image_transforms ) if cfg .image_transforms .enable else None
179179
180- if isinstance (cfg .grounding , str ) + isinstance (cfg .repo_id , str ) != 1 :
181- raise ValueError ("Exactly one of `cfg.grounding ` and `cfg.repo_id` should be provided." )
180+ if isinstance (cfg .vqa , str ) + isinstance (cfg .repo_id , str ) != 1 :
181+ raise ValueError ("Exactly one of `cfg.vqa ` and `cfg.repo_id` should be provided." )
182182
183- if isinstance (cfg .grounding , str ):
184- ds_cls = available_grounding_datasets .get (cfg .grounding )
183+ if isinstance (cfg .vqa , str ):
184+ ds_cls = available_vqa_datasets .get (cfg .vqa )
185185 if ds_cls is None :
186186 raise ValueError (
187- f"Unknown grounding dataset '{ cfg .grounding } '. "
188- f"Supported datasets are: { available_grounding_datasets .keys ()} "
187+ f"Unknown vqa dataset '{ cfg .vqa } '. Supported datasets are: { available_vqa_datasets .keys ()} "
189188 )
190189 # TODO support dataset-specific arg / kwargs
191190 dataset = ds_cls (train_cfg )
@@ -210,8 +209,8 @@ def make_dataset(
210209 return_advantage_input = return_advantage_input ,
211210 )
212211
213- # TODO grounding datasets implement stats in original feature names, but camera_keys are standardized names
214- if not isinstance (cfg .grounding , str ) and "dummy" not in cfg .repo_id and cfg .use_imagenet_stats :
212+ # TODO vqa datasets implement stats in original feature names, but camera_keys are standardized names
213+ if not isinstance (cfg .vqa , str ) and "dummy" not in cfg .repo_id and cfg .use_imagenet_stats :
215214 for key in dataset .meta .camera_keys :
216215 for stats_type , stats in IMAGENET_STATS .items ():
217216 if key not in dataset .meta .stats :
0 commit comments