Skip to content

Commit 7603ad6

Browse files
fixed record function with names
1 parent baab583 commit 7603ad6

File tree

2 files changed

+133
-148
lines changed

2 files changed

+133
-148
lines changed

lerobot/common/datasets/populate_dataset.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def wrapper(*args, **kwargs):
4848

4949

5050
def save_image(img_tensor, key, frame_index, episode_index, videos_dir: str):
51-
img = Image.fromarray(img_tensor.numpy())
51+
if torch.is_tensor(img_tensor):
52+
img_tensor = img_tensor.numpy()
53+
img = Image.fromarray(img_tensor)
5254
path = Path(videos_dir) / f"{key}_episode_{episode_index:06d}" / f"frame_{frame_index:06d}.png"
5355
path.parent.mkdir(parents=True, exist_ok=True)
5456
img.save(str(path), quality=100)

0 commit comments

Comments
 (0)