lefold-preview / README.md
cat314's picture
Upload README.md with huggingface_hub
3619b00 verified
|
Raw
History Blame Contribute Delete
5.52 kB
---
license: mit
task_categories:
- robotics
- reinforcement-learning
language: []
pretty_name: LeFold Preview
size_categories:
- 10M<n<100M
tags:
- lerobot
- so101
- dual-arm
- manipulation
- folding
- cloth
---
# LeFold Preview
This is a preview dataset for **LeFold**, a dual-arm cloth folding manipulation dataset collected with the **SO-101** dual-arm robot. The dataset is built using the [LeRobot](https://github.com/huggingface/lerobot) v3.0 format and is fully compatible with LeRobot training pipelines.
## Dataset Summary
| Property | Value |
|----------|-------|
| Robot | SO-101 Dual Arm (`so101_dualarm`) |
| Total Episodes | 1,200 |
| Total Frames | 738,533 |
| Number of Tasks | 4 |
| FPS | 30 |
| Action Dim | 12 (6 per arm) |
| State Dim | 12 (6 joint positions per arm) |
| Arm Spacing | 46 cm (center-to-center of two arm bases) |
### Task Categories
| Task Index | Task | Episodes | Frames |
|------------|------|----------|--------|
| 0 | Fold the long pants (长裤折叠) | 300 | 162,084 |
| 1 | Fold the long sleeves (长袖折叠) | 300 | 246,170 |
| 2 | Fold the short pants (短裤折叠) | 300 | 90,854 |
| 3 | Fold the short sleeves (短袖折叠) | 300 | 239,425 |
## Observation Space
### Cameras
| Camera Key | Resolution | Codec | Description |
|------------|-----------|-------|-------------|
| `observation.images.left_wrist` | 480×640 | AV1 (yuv420p) | Left wrist-mounted camera |
| `observation.images.right_wrist` | 480×640 | AV1 (yuv420p) | Right wrist-mounted camera |
| `observation.images.right_front` | 720×1280 | AV1 (yuv420p) | Right front view camera |
### State
Joint positions (float32 × 12):
| Index | Joint Name |
|-------|------------|
| 0 | `left.shoulder_pan.pos` |
| 1 | `left.shoulder_lift.pos` |
| 2 | `left.elbow_flex.pos` |
| 3 | `left.wrist_flex.pos` |
| 4 | `left.wrist_roll.pos` |
| 5 | `left.gripper.pos` |
| 6 | `right.shoulder_pan.pos` |
| 7 | `right.shoulder_lift.pos` |
| 8 | `right.elbow_flex.pos` |
| 9 | `right.wrist_flex.pos` |
| 10 | `right.wrist_roll.pos` |
| 11 | `right.gripper.pos` |
## Action Space
12-dimensional continuous action (same structure as state, 6 DoF per arm).
## Splits
| Split | Episodes |
|-------|----------|
| Train | 0–1200 |
## Usage
```python
from lerobot.datasets import LeRobotDataset
dataset = LeRobotDataset(
repo_id="cmriat/lefold-preview",
split="train",
)
```
Or download directly via `huggingface-cli`:
```bash
huggingface-cli download cmriat/lefold-preview --repo-type dataset
```
### Training
First install LeRobot with training dependencies:
```bash
pip install lerobot[training]
```
#### Method 1: Training Config File (Recommended)
Create a config file `train_lefold.yaml`:
```yaml
dataset:
repo_id: cmriat/lefold-preview
video_backend: pyav
policy:
type: pi05 # PI0.5 — flow-matching vision-language-action policy
device: cuda
push_to_hub: false
pretrained_path: lerobot/pi05_base # fine-tune from PI05 base checkpoint
paligemma_variant: gemma_2b
action_expert_variant: gemma_300m
dtype: bfloat16
chunk_size: 30 # action prediction horizon
n_obs_steps: 1
max_state_dim: 32
max_action_dim: 32
image_resolution: [224, 224]
use_relative_actions: true # predict delta joint positions
relative_exclude_joints: ["gripper"]
n_action_steps: 10 # execute first 10 predicted actions
num_inference_steps: 10 # flow-matching inference steps
input_features:
observation.state:
type: STATE
shape: [12]
observation.images.left_wrist:
type: VISUAL
shape: [3, 224, 224]
observation.images.right_front:
type: VISUAL
shape: [3, 224, 224]
observation.images.right_wrist:
type: VISUAL
shape: [3, 224, 224]
output_features:
action:
type: ACTION
shape: [12]
batch_size: 16
steps: 60000
save_freq: 5000
log_freq: 100
num_workers: 8
optimizer:
type: adamw
lr: 3e-5
betas: [0.9, 0.95]
eps: 1e-8
weight_decay: 0.01
grad_clip_norm: 1.0
scheduler:
type: cosine_decay_with_warmup
num_warmup_steps: 1200
num_decay_steps: 60000
peak_lr: 3e-5
decay_lr: 3e-6
wandb:
enable: true
project: lefold-so101
disable_artifact: true
output_dir: outputs/lefold_pi05
job_name: lefold_pi05
```
Then launch training:
```bash
lerobot-train --config_path train_lefold.yaml
```
#### Method 2: CLI Only
For quick experiments without a config file:
```bash
lerobot-train \
--dataset.repo_id=cmriat/lefold-preview \
--policy.type=pi05 \
--policy.pretrained_path=lerobot/pi05_base \
--policy.device=cuda \
--policy.use_relative_actions=true \
--batch_size=16 \
--steps=60000 \
--output_dir=outputs/lefold_pi05 \
--wandb.enable=true \
--wandb.project=lefold-so101
```
For other supported policy types (e.g., ACT, Diffusion, multi-task DIT, SmolVLA), replace `--policy.type` above or refer to the [LeRobot documentation](https://github.com/huggingface/lerobot).
> **Note on SO-101 hardware setup:**
> - The two arms of the SO-101 dual-arm robot are mounted with their base centers **46 cm apart**. When deploying a trained policy, ensure your hardware setup matches this spacing for consistent kinematics.
> - The front camera is positioned **between the two arms**, and the camera views are aligned via **RGB image matching** (i.e., adjusting camera pose until the RGB frames from each camera are visually consistent with the dataset).
## License
MIT