Skip to content

Commit a8db91c

Browse files
ctbflalibertspre-commit-ci[bot]imstevenpmwork
authored
Fix Windows HTML visualization to make videos could be seen (#647)
Co-authored-by: Simon Alibert <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Palma <[email protected]>
1 parent 0f5f7ac commit a8db91c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lerobot/scripts/visualize_dataset_html.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@ def show_episode(dataset_namespace, dataset_name, episode_id, dataset=dataset, e
174174
dataset.meta.get_video_file_path(episode_id, key) for key in dataset.meta.video_keys
175175
]
176176
videos_info = [
177-
{"url": url_for("static", filename=video_path), "filename": video_path.parent.name}
177+
{
178+
"url": url_for("static", filename=str(video_path).replace("\\", "/")),
179+
"filename": video_path.parent.name,
180+
}
178181
for video_path in video_paths
179182
]
180183
tasks = dataset.meta.episodes[episode_id]["tasks"]
@@ -381,7 +384,7 @@ def visualize_dataset_html(
381384
if isinstance(dataset, LeRobotDataset):
382385
ln_videos_dir = static_dir / "videos"
383386
if not ln_videos_dir.exists():
384-
ln_videos_dir.symlink_to((dataset.root / "videos").resolve())
387+
ln_videos_dir.symlink_to((dataset.root / "videos").resolve().as_posix())
385388

386389
if serve:
387390
run_server(dataset, episodes, host, port, static_dir, template_dir)

0 commit comments

Comments
 (0)