Skip to content

LeRobot v3 writer: non-uint8 frames clip in image mode but wrap in video mode #2

Description

@griswaldbrooks

For camera frames that are not uint8, the two LeRobot v3 writer modes convert differently:

  • image mode (video=False) clips: np.clip(array, 0, 255).astype(np.uint8)
  • video mode goes through forge.video.encoder.VideoEncoder, which wraps: .astype(np.uint8)

A uint16 source therefore yields different pixels depending on the mode. Clipping is the
more defensible behaviour; the two paths should agree, and a scaling conversion
(array >> 8 or a full-range rescale) is probably what a 16-bit source actually wants.

Deferred from the LeRobot v3 image-mode PR; targeted at a patch release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions