mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-21 19:49:49 +00:00
fix hf_dataset.set_transform(hf_transform_to_torch)
This commit is contained in:
committed by
Michel Aractingi
parent
01bc89b6f4
commit
ad1ad11eac
@@ -56,8 +56,8 @@ def calculate_episode_data_index(hf_dataset: datasets.Dataset) -> dict[str, np.n
|
|||||||
def synced_timestamps_factory(hf_dataset_factory):
|
def synced_timestamps_factory(hf_dataset_factory):
|
||||||
def _create_synced_timestamps(fps: int = 30) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
|
def _create_synced_timestamps(fps: int = 30) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
|
||||||
hf_dataset = hf_dataset_factory(fps=fps)
|
hf_dataset = hf_dataset_factory(fps=fps)
|
||||||
timestamps = hf_dataset["timestamp"].numpy()
|
timestamps = torch.stack(hf_dataset["timestamp"]).numpy()
|
||||||
episode_indices = hf_dataset["episode_index"].numpy()
|
episode_indices = torch.stack(hf_dataset["episode_index"]).numpy()
|
||||||
episode_data_index = calculate_episode_data_index(hf_dataset)
|
episode_data_index = calculate_episode_data_index(hf_dataset)
|
||||||
return timestamps, episode_indices, episode_data_index
|
return timestamps, episode_indices, episode_data_index
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user