diff --git a/src/lerobot/datasets/multi_dataset.py b/src/lerobot/datasets/multi_dataset.py index b4b7a941d..b955c1114 100644 --- a/src/lerobot/datasets/multi_dataset.py +++ b/src/lerobot/datasets/multi_dataset.py @@ -123,7 +123,7 @@ class MultiLeRobotDataset(torch.utils.data.Dataset): NOTE: Fow now, this relies on a check in __init__ to make sure all sub-datasets have the same info. """ - return self._datasets[0].meta.info["fps"] + return self._datasets[0].meta.info.fps @property def video(self) -> bool: @@ -133,7 +133,7 @@ class MultiLeRobotDataset(torch.utils.data.Dataset): NOTE: Fow now, this relies on a check in __init__ to make sure all sub-datasets have the same info. """ - return self._datasets[0].meta.info.get("video", False) + return len(self._datasets[0].meta.video_keys) > 0 @property def features(self) -> datasets.Features: diff --git a/src/lerobot/datasets/utils.py b/src/lerobot/datasets/utils.py index 3876e9f24..715bd2f9b 100644 --- a/src/lerobot/datasets/utils.py +++ b/src/lerobot/datasets/utils.py @@ -416,7 +416,7 @@ def create_branch(repo_id: str, *, branch: str, repo_type: str | None = None) -> def create_lerobot_dataset_card( tags: list | None = None, - dataset_info: dict | None = None, + dataset_info: DatasetInfo | None = None, **kwargs, ) -> DatasetCard: """Create a `DatasetCard` for a LeRobot dataset. @@ -427,7 +427,7 @@ def create_lerobot_dataset_card( Args: tags (list | None): A list of tags to add to the dataset card. - dataset_info (dict | None): The dataset's info dictionary, which will + dataset_info (DatasetInfo | None): The dataset's info object, which will be displayed on the card. **kwargs: Additional keyword arguments to populate the card template. @@ -440,7 +440,7 @@ def create_lerobot_dataset_card( card_tags += tags if dataset_info: dataset_structure = "[meta/info.json](meta/info.json):\n" - dataset_structure += f"```json\n{json.dumps(dataset_info, indent=4)}\n```\n" + dataset_structure += f"```json\n{json.dumps(dataset_info.to_dict(), indent=4)}\n```\n" kwargs = {**kwargs, "dataset_structure": dataset_structure} card_data = DatasetCardData( license=kwargs.get("license"), diff --git a/src/lerobot/scripts/convert_dataset_v21_to_v30.py b/src/lerobot/scripts/convert_dataset_v21_to_v30.py index 73360fd15..f516aa8fc 100644 --- a/src/lerobot/scripts/convert_dataset_v21_to_v30.py +++ b/src/lerobot/scripts/convert_dataset_v21_to_v30.py @@ -168,7 +168,7 @@ def legacy_load_tasks(local_dir: Path) -> tuple[dict, dict]: def validate_local_dataset_version(local_path: Path) -> None: """Validate that the local dataset has the expected v2.1 version.""" info = load_info(local_path) - dataset_version = info.get("codebase_version", "unknown") + dataset_version = info.codebase_version or "unknown" if dataset_version != V21: raise ValueError( f"Local dataset has codebase version '{dataset_version}', expected '{V21}'. "