Skip to content

Add create reward visualization #3155

Merged
pkooij merged 12 commits into
mainfrom
feat/analysis_dataset
Apr 2, 2026
Merged

Add create reward visualization #3155
pkooij merged 12 commits into
mainfrom
feat/analysis_dataset

Conversation

@pkooij
Copy link
Copy Markdown
Member

@pkooij pkooij commented Mar 13, 2026

Title

Add reward visualization also used in blog post

Checklist (required before merge)

  • Linting/formatting run (pre-commit run -a)
  • All tests pass locally (pytest)
  • Documentation updated
  • CI is green

@github-actions github-actions Bot added the examples Issues related to the examples label Mar 13, 2026
@pkooij pkooij changed the title Add create reward visualization and multimodal analysis tool Add create reward visualization Mar 18, 2026
@pkooij pkooij self-assigned this Mar 18, 2026
Comment thread examples/dataset/create_progress_videos.py
Comment thread examples/dataset/visualization_tools/create_progress_videos.py Outdated
Comment thread examples/dataset/visualization_tools/create_progress_videos.py Outdated
Comment thread examples/dataset/visualization_tools/create_progress_videos.py Outdated
Comment thread examples/dataset/create_progress_videos.py
Comment thread examples/dataset/visualization_tools/create_progress_videos.py Outdated
Comment thread examples/dataset/visualization_tools/create_progress_videos.py Outdated
Comment thread examples/dataset/create_progress_videos.py
Comment thread examples/dataset/create_progress_videos.py
Comment thread examples/dataset/visualization_tools/create_progress_videos.py Outdated
Copy link
Copy Markdown
Member

@s1lent4gnt s1lent4gnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice, but I would love to consider these comments:

  • Consider placing create_progress_videos.py at the same level as other scripts to stay consistent.
  • Add return types to all functions for consistency.
  • Add Args and Returns in functions docstring would help readability.
  • Use descriptive variable names, the script is simple but it would be nice if you stay consistent with lerobot codebase.
  • OpenCV can seek directly into the original video with cap.set(cv2.CAP_PROP_POS_MSEC, from_ts * 1000), eliminating one full decode/encode cycle in clip extraction from chunk and the intermediate file.
  • Consider making MP4 the default output with GIF as an optional flag.
  • The clip is opened three times: in composite_video, All three should be consolidated into a single open.

pkooij and others added 3 commits March 26, 2026 12:58
- Add shebang and Apache 2.0 license header
- Replace hardcoded absolute OUTPUT_DIR with relative default (./progress_videos)
- Add argparse CLI (--repo-id, --episode, --camera-key, --output-dir, --gif)
- Wrap entrypoint in def main()
- Replace all print() with logging
- Use logging.error/warning instead of traceback.print_exc
- Release VideoCapture via try/finally; consolidate triple-open into single seek
- Eliminate intermediate clip file: seek directly via CAP_PROP_POS_MSEC
- Make MP4 the default output, GIF opt-in via --gif flag
- Add return types to all functions
- Add Args/Returns docstrings
- Use descriptive variable names throughout

Made-with: Cursor
Comment thread examples/dataset/create_progress_videos.py Outdated
Comment thread examples/dataset/create_progress_videos.py Outdated
Comment thread examples/dataset/create_progress_videos.py Outdated
Comment thread examples/dataset/create_progress_videos.py Outdated
Comment thread examples/dataset/create_progress_videos.py Outdated
Comment thread examples/dataset/create_progress_videos.py Outdated
Comment thread examples/dataset/create_progress_videos.py Outdated
Comment thread examples/dataset/create_progress_videos.py Outdated
Comment thread examples/dataset/create_progress_videos.py Outdated
pkooij and others added 2 commits March 31, 2026 19:39
- Replace Unicode ellipsis and multiplication sign with ASCII equivalents
- Fix step numbering from 1-5 to 1-4 (only 4 actual steps)
- Move frame_width reading into convert_mp4_to_gif
- Remove unused text_height variable

Made-with: Cursor
Copy link
Copy Markdown
Member

@s1lent4gnt s1lent4gnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Chad

@pkooij pkooij merged commit 2cf08b7 into main Apr 2, 2026
5 checks passed
@pkooij pkooij deleted the feat/analysis_dataset branch April 2, 2026 14:58
AtticusZeller added a commit to AtticusZeller/lerobot that referenced this pull request Apr 11, 2026
* Add create reward visualization and multimodal analysis tool

* add example for creating progress video for sarm

* nit

* precommit

* refactor: address review comments on create_progress_videos.py

- Add shebang and Apache 2.0 license header
- Replace hardcoded absolute OUTPUT_DIR with relative default (./progress_videos)
- Add argparse CLI (--repo-id, --episode, --camera-key, --output-dir, --gif)
- Wrap entrypoint in def main()
- Replace all print() with logging
- Use logging.error/warning instead of traceback.print_exc
- Release VideoCapture via try/finally; consolidate triple-open into single seek
- Eliminate intermediate clip file: seek directly via CAP_PROP_POS_MSEC
- Make MP4 the default output, GIF opt-in via --gif flag
- Add return types to all functions
- Add Args/Returns docstrings
- Use descriptive variable names throughout

Made-with: Cursor

* refactor: move create_progress_videos.py to examples/dataset/ for consistency

Made-with: Cursor

* refactor: address PR review comments on create_progress_videos.py

- Replace Unicode ellipsis and multiplication sign with ASCII equivalents
- Fix step numbering from 1-5 to 1-4 (only 4 actual steps)
- Move frame_width reading into convert_mp4_to_gif
- Remove unused text_height variable

Made-with: Cursor
AriannaPietrasanta pushed a commit to gbionics/lerobot that referenced this pull request Apr 30, 2026
* Add create reward visualization and multimodal analysis tool

* add example for creating progress video for sarm

* nit

* precommit

* refactor: address review comments on create_progress_videos.py

- Add shebang and Apache 2.0 license header
- Replace hardcoded absolute OUTPUT_DIR with relative default (./progress_videos)
- Add argparse CLI (--repo-id, --episode, --camera-key, --output-dir, --gif)
- Wrap entrypoint in def main()
- Replace all print() with logging
- Use logging.error/warning instead of traceback.print_exc
- Release VideoCapture via try/finally; consolidate triple-open into single seek
- Eliminate intermediate clip file: seek directly via CAP_PROP_POS_MSEC
- Make MP4 the default output, GIF opt-in via --gif flag
- Add return types to all functions
- Add Args/Returns docstrings
- Use descriptive variable names throughout

Made-with: Cursor

* refactor: move create_progress_videos.py to examples/dataset/ for consistency

Made-with: Cursor

* refactor: address PR review comments on create_progress_videos.py

- Replace Unicode ellipsis and multiplication sign with ASCII equivalents
- Fix step numbering from 1-5 to 1-4 (only 4 actual steps)
- Move frame_width reading into convert_mp4_to_gif
- Remove unused text_height variable

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples Issues related to the examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants