mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-24 02:06:15 +00:00
refactoring the last few old fieds
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -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.
|
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
|
@property
|
||||||
def video(self) -> bool:
|
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.
|
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
|
@property
|
||||||
def features(self) -> datasets.Features:
|
def features(self) -> datasets.Features:
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ def create_branch(repo_id: str, *, branch: str, repo_type: str | None = None) ->
|
|||||||
|
|
||||||
def create_lerobot_dataset_card(
|
def create_lerobot_dataset_card(
|
||||||
tags: list | None = None,
|
tags: list | None = None,
|
||||||
dataset_info: dict | None = None,
|
dataset_info: DatasetInfo | None = None,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> DatasetCard:
|
) -> DatasetCard:
|
||||||
"""Create a `DatasetCard` for a LeRobot dataset.
|
"""Create a `DatasetCard` for a LeRobot dataset.
|
||||||
@@ -427,7 +427,7 @@ def create_lerobot_dataset_card(
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
tags (list | None): A list of tags to add to the dataset card.
|
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.
|
be displayed on the card.
|
||||||
**kwargs: Additional keyword arguments to populate the card template.
|
**kwargs: Additional keyword arguments to populate the card template.
|
||||||
|
|
||||||
@@ -440,7 +440,7 @@ def create_lerobot_dataset_card(
|
|||||||
card_tags += tags
|
card_tags += tags
|
||||||
if dataset_info:
|
if dataset_info:
|
||||||
dataset_structure = "[meta/info.json](meta/info.json):\n"
|
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}
|
kwargs = {**kwargs, "dataset_structure": dataset_structure}
|
||||||
card_data = DatasetCardData(
|
card_data = DatasetCardData(
|
||||||
license=kwargs.get("license"),
|
license=kwargs.get("license"),
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ def legacy_load_tasks(local_dir: Path) -> tuple[dict, dict]:
|
|||||||
def validate_local_dataset_version(local_path: Path) -> None:
|
def validate_local_dataset_version(local_path: Path) -> None:
|
||||||
"""Validate that the local dataset has the expected v2.1 version."""
|
"""Validate that the local dataset has the expected v2.1 version."""
|
||||||
info = load_info(local_path)
|
info = load_info(local_path)
|
||||||
dataset_version = info.get("codebase_version", "unknown")
|
dataset_version = info.codebase_version or "unknown"
|
||||||
if dataset_version != V21:
|
if dataset_version != V21:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Local dataset has codebase version '{dataset_version}', expected '{V21}'. "
|
f"Local dataset has codebase version '{dataset_version}', expected '{V21}'. "
|
||||||
|
|||||||
Reference in New Issue
Block a user