-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: Remove --local-files-only
from the README
and update root/repo_id
path in lerobot_dataset.py
#1057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tc-huang
wants to merge
21
commits into
huggingface:main
Choose a base branch
from
tc-huang:fix/local-files-only-arg-in-md
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix: Remove --local-files-only
from the README
and update root/repo_id
path in lerobot_dataset.py
#1057
tc-huang
wants to merge
21
commits into
huggingface:main
from
tc-huang:fix/local-files-only-arg-in-md
+5
−6
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The `--local-files-only` argument and its related instructions were removed from the following documentation files to reflect changes introduced in commit 3354d91 "LeRobotDataset v2.1 (huggingface#711)", which removed the `--local-files-only` argument from `lerobot/scripts/visualize_dataset.py` and `lerobot/scripts/visualize_dataset_html.py`. Updated files: 1. README.md 2. examples/7_get_started_with_real_robot.md 3. examples/10_use_so100.md 4. examples/11_use_lekiwi.md 5. examples/11_use_moss.md 6. examples/12_use_so101.md
Modified the `LeRobotDataset.__init__` method to append the `repo_id` to the specified `root` path. Before change: - If `root` was None => `HF_LEROBOT_HOME / repo_id` - If `root` was provided => `Path(root)` After change: - If `root` was None => `HF_LEROBOT_HOME / repo_id` - If `root` was provided => `Path(root) / repo_id` This change ensures that the local dataset stored in a subdirectory named after their repo_id, aligning with the LeRobotDataset docstring: "Locally, the dataset will be stored under root/repo_id."
2 tasks
**Dataset**: Modified `LeRobotDatasetMetadata.create` to append `repo_id` to `root` path. - Before: `root = HF_LEROBOT_HOME / repo_id` (if None) or `root = Path(root)` (if provided). - Now: `root = HF_LEROBOT_HOME / repo_id` (if None) or `root = Path(root) / repo_id` (if provided). **Tests**: Updated `test_record_and_replay_and_policy` in `tests/robots/test_control_robot.py` to remove `repo_id` from `root` path. - Before: `root = tmp_path / "data" / repo_id` (i.e., `tmp_path/data/lerobot_test/debug`). - Now: `root = tmp_path / "data"` (i.e., `tmp_path/data`).
Updated test cases in `tests/robots/test_control_robot.py` to remove `repo_id` or `eval_repo_id` from the `root` path used for test data storage. **Changes**: 1. `test_record_without_cameras`: - Before: `root = tmp_path / "data" / repo_id` (i.e., `tmp_path/data/lerobot_test/debug`) - Now: `root = tmp_path / "data"` (i.e., `tmp_path/data`) 2. `test_record_and_replay_and_policy`: - Before: `eval_root = tmp_path / "data" / eval_repo_id` (i.e., `tmp_path/data/lerobot/eval_debug`) - Now: `eval_root = tmp_path / "data"` (i.e., `tmp_path/data`) 3. `test_resume_record`: - Before: `root = tmp_path / "data" / repo_id` (i.e., `tmp_path/data/lerobot_test/debug`) - Now: `root = tmp_path / "data"` (i.e., `tmp_path/data`) 4. `test_record_with_event_rerecord_episode`: - Before: `root = tmp_path / "data" / repo_id` (i.e., `tmp_path/data/lerobot_test/debug`) - Now: `root = tmp_path / "data"` (i.e., `tmp_path/data`) 5. `test_record_with_event_exit_early`: - Before: `root = tmp_path / "data" / repo_id` (i.e., `tmp_path/data/lerobot_test/debug`) - Now: `root = tmp_path / "data"` (i.e., `tmp_path/data`) 6. `test_record_with_event_stop_recording`: - Before: `root = tmp_path / "data" / repo_id` (i.e., `tmp_path/data/lerobot_test/debug`) - Now: `root = tmp_path / "data"` (i.e., `tmp_path/data`)
--local-files-only
from docs and append repo_id
to root
in LeRobotDataset.__init__
--local-files-only
from docs and update root/repo_id
path in lerobot_dataset.py
- Updated `LeRobotDatasetMetadata.__init__` to append `repo_id` to `root`: - Old: `self.root = HF_LEROBOT_HOME / repo_id` (if `root` is None) or `self.root = Path(root)` (if `root` is provided). - New: `root = HF_LEROBOT_HOME / repo_id` (if `root` is None) or `root = Path(root) / repo_id` (if `root` is provided). - Fixed `LeRobotDatasetMetadata` init call in `LeRobotDataset.__init__`: - Old: `self.meta = LeRobotDatasetMetadata(...self.root,...)`. - New: `self.meta = LeRobotDatasetMetadata(...root,...)`. - Prevents duplicate `repo_id` appending in dataset path.
for more information, see https://pre-commit.ci
e81d2dc
to
0e54b2c
Compare
--local-files-only
from docs and update root/repo_id
path in lerobot_dataset.py
--local-files-only
from the README
and update root/repo_id
path in lerobot_dataset.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What This PR Does
This PR introduces two changes:
Change 1: Remove the Instruction for the
--local-files-only
Argument fromREADME.md
--local-files-only
argument and its instructions were removed fromREADME.md
to align with changes in commit 3354d91 (LeRobotDataset v2.1, PR LeRobotDataset v2.1 #711), which removed--local-files-only
fromlerobot/scripts/visualize_dataset.py
(commit diff) andlerobot/scripts/visualize_dataset_html.py
(commit diff).--local-files-only
argument inlerobot/scripts/visualize_dataset.py
andlerobot/scripts/visualize_dataset_html.py
is deprecated. Users should now use the--root
and--repo-id
options, as shown in the updatedREADME.md
example:python lerobot/scripts/visualize_dataset.py \ --repo-id lerobot/pusht \ --root ./my_local_data_dir \ - --local-files-only 1 \ --episode-index 0
./my_local_data_dir/lerobot/pusht
, as described in theLeRobotDataset
class parameter docstring:lerobot/lerobot/common/datasets/lerobot_dataset.py
Lines 418 to 423 in 6007a22
Updated Files for Change 1:
README.md
Change 2: Update
root
path for dataset and metadata store locallyUpdated the
__init__
method of theLeRobotDataset
andLeRobotDatasetMetadata
class to support local datasets stored underroot/repo_id
:__init__
method did not correctly handle local dataset paths with theroot/repo_id
structure, causinglerobot/scripts/visualize_dataset.py
andlerobot/scripts/visualize_dataset_html.py
to fail to load datasets located atroot/repo_id
.Update
LeRobotDatasetMetadata
init call inLeRobotDataset
class, changingself.root
toroot
to avoid duplicaterepo_id
appending.Updated the
create
method of theLeRobotDatasetMetadata
class to support local metadata stored underroot/repo_id
:Updated Files for Change 2:
lerobot/common/datasets/lerobot_dataset.py
How It Was Tested
Preparing the
pusht
Dataset Locallycd lerobot
repository directory.pusht
dataset using the same instructions inREADME.md
to verify that visualization from the Hugging Face Hub can work:~/.cache/huggingface/lerobot/lerobot/pusht
by default.my_local_data_dir
) for testing:mkdir my_local_data_dir mv ~/.cache/huggingface/lerobot/lerobot my_local_data_dir
Test 1: Visualize Local Dataset with
visualize_dataset.py
my_local_data_dir
using:Test 2: Visualize Local Dataset with
visualize_dataset_html.py
my_local_data_dir
using:Test 3: Train with Local Dataset
Test 4: Create
LeRobotDatasetMetadata
andLeRobotDataset
instances using simple Python codeTest 5: Functional Testing with Physical Robot and Local Dataset
my_local_data_dir/lerobot_user/koch_test
(e.g., using thekoch
arm).--robot.port
and--teleop.id
arguments should be replaced with your actual USB port values.my_local_data_dir/lerobot_user/koch_test
(e.g., using thekoch
arm).--robot.port
argument should be replaced with your actual USB port value.my_local_data_dir/lerobot_user/koch_test
using the Rerun UI.my_local_data_dir/lerobot_user/koch_test
using the HTML UI.my_local_data_dir/lerobot_user/koch_test
.How to Review & Test
README.md
.--robot.type=koch_follower
andteleop.type=koch_leader
if you use a robot arm other thankoch
.)This PR is related to issue #963.