Skip to content

Conversation

@wuxiaoqiang12
Copy link

Description:

This PR optimizes the visualization pipeline by introducing an optional image downsampling mechanism for Rerun.

The Problem:
When recording or replaying high-resolution datasets (e.g., 1080p * n), Rerun's default behavior of caching full-resolution frames leads to excessive RAM consumption and system lag, especially during long recording sessions on edge devices.

The Solution:
Added a dynamic resizing logic in log_rerun_data. If the environment variable LEROBOT_RERUN_MAX_IMAGE_WIDTH is set, images sent to Rerun will be downsampled to that width while maintaining the aspect ratio.

Key Features:

  • Non-intrusive: Uses an environment variable to avoid breaking existing API signatures.
  • Efficiency: Uses cv2.INTER_AREA for high-quality downsampling.
  • Preservation: This optimization only affects the Rerun preview; the original high-quality data saved to disk or used for training remains untouched.

Environment Variable:

  • LEROBOT_RERUN_MAX_IMAGE_WIDTH: Set the maximum width (e.g., 480 or 640) for images displayed in Rerun.

Testing:

  • Recorded a dataset at 1920x1080.
  • With export LEROBOT_RERUN_MAX_IMAGE_WIDTH=480: Memory usage remained stable throughout the entire session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant