Skip to content

fix(dataset): patches torchvision transforms registration#3316

Open
fracapuano wants to merge 1 commit intohuggingface:mainfrom
fracapuano:fracapuano/patch-torchvision-transforms
Open

fix(dataset): patches torchvision transforms registration#3316
fracapuano wants to merge 1 commit intohuggingface:mainfrom
fracapuano:fracapuano/patch-torchvision-transforms

Conversation

@fracapuano
Copy link
Copy Markdown
Contributor

@fracapuano fracapuano commented Apr 8, 2026

Title

Patches comments from @imstevenpmwork on #3153

Type / Scope

  • Type: Chore
  • Scope: patch

Summary / Motivation

NA

Related issues

See #3152

What changed

  • Taking in @imstevenpmwork comments, mostly related to separation of concerns between LeRobotDataset facade and the newly introduced double Writer/Reader backends.

How was this tested (or how to run locally)

  • Ran normal tests

Checklist (required before merge)

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

Reviewer notes

  • Anything the reviewer should focus on (performance, edge-cases, specific files) or general notes.
  • Anyone in the community is free to review the PR.

Copilot AI review requested due to automatic review settings April 8, 2026 09:07
@github-actions github-actions bot added dataset Issues regarding data inputs, processing, or datasets tests Problems with test coverage, failures, or improvements to testing labels Apr 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refines how image transforms are managed for LeRobotDataset/DatasetReader, aligning with the “separation of concerns” goal from #3152 by moving transform mutation behind explicit reader APIs rather than directly touching private state.

Changes:

  • Add DatasetReader.set_image_transforms() / clear_image_transforms() and route initialization through the setter for consistent validation.
  • Update LeRobotDataset to validate/store image_transforms in the facade and propagate updates via the reader’s public setter (no direct _image_transforms access).
  • Add a regression test ensuring reader-level set/clear updates runtime behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/lerobot/datasets/dataset_reader.py Introduces reader-level transform setter/clear APIs and centralizes validation.
src/lerobot/datasets/lerobot_dataset.py Validates/stores transforms on the facade and propagates via reader public methods.
tests/datasets/test_dataset_reader.py Adds coverage for runtime transform updates/clearing on DatasetReader.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

dataset Issues regarding data inputs, processing, or datasets tests Problems with test coverage, failures, or improvements to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants