Skip to content

Conversation

@vovw
Copy link

@vovw vovw commented Oct 28, 2025

What this does

Adds add_feature operation to the lerobot_edit_dataset script, allowing users to add
new features to existing datasets from numpy files.

How it was tested

  • Added handle_add_feature function in src/lerobot/scripts/lerobot_edit_dataset.py
  • Implemented feature loading from .npy files with validation for:
    • Data length matching dataset total frames
    • Required metadata (dtype, shape, names)
    • File existence checks
  • Integrated with existing add_features utility from dataset_tools
  • Added documentation and usage example in docstring

Create a sample feature file

python -c "import numpy as np; np.save('rewards.npy', np.random.randn(1000,1).astype('float32'))"

Add feature to dataset

python -m lerobot.scripts.lerobot_edit_dataset \
    --repo_id lerobot/pusht \
    --operation.type add_feature \
    --operation.features '{"reward": {"file": "rewards.npy", "dtype": "float32", "shape": [1], "names": null}}'

resolves one of the #2326

Copilot AI review requested due to automatic review settings October 28, 2025 15:13
Copy link
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

Adds support for a new add_feature operation to the lerobot_edit_dataset.py script, enabling users to add new features to existing datasets by loading data from numpy files.

  • Implements handle_add_feature function with validation for data length, metadata, and file existence
  • Adds AddFeatureConfig dataclass for configuration
  • Updates documentation with usage examples

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

@vovw vovw requested a review from Copilot October 28, 2025 15:22
Copy link
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


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

vovw and others added 2 commits October 28, 2025 21:04
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