Views
No views yet
CrazyMoment/teleop_recorded_rh56f1_hookonly
teleop dataset (HDR35_20 + RH56F1_R hand, "remove hook ring from chassis" task).| Algorithm | Diffusion Policy (1D UNet) with rectified-flow loss |
| Noise scheduler | FlowMatch (num_inference_steps=1, Euler ODE) |
| Vision backbone | facebook/dinov2-small (frozen) |
| Cameras | d405 (240×320) + zivid (240×320, downsampled from 1050×1458) |
| State dim | 141 |
| Action dim | 12 |
| Horizon / n_obs_steps / n_action_steps | 16 / 2 / 8 |
| Training steps | 200,000 (batch 64, ~223 epochs over 57,388 frames) |
| Image augmentations | lerobot image_transforms with domain randomization (p=0.5, max_num=3) |
| Optimizer | AdamW, lr=1e-4 cosine (warmup 500), wd=1e-6, β=(0.95, 0.999) |
| Final train loss | 0.013 |
| Hardware | NVIDIA A100 80GB · 24h 43m |
| File | Purpose |
|---|---|
model.safetensors | Policy weights |
config.json | DiffusionConfig |
train_config.json | Full training config snapshot |
policy_preprocessor.json + .safetensors | Normalizer pipeline (state/action MIN_MAX, visual IDENTITY) |
policy_postprocessor.json + .safetensors | Action unnormalizer pipeline |
1git clone https://github.com/huggingface/lerobot
2cd lerobot && pip install -e .
3pip install transformers1import torch
2from lerobot.configs.policies import PreTrainedConfig
3from lerobot.policies.diffusion.modeling_diffusion import DiffusionPolicy
4from lerobot.policies.factory import make_pre_post_processors
5
6REPO = "Ngseo/rh56f1_diffusion_dinov2s_flowmatch_multicam_dr"
7DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
8
9# 1) Load config + policy + pre/post processors from the Hub
10cfg = PreTrainedConfig.from_pretrained(REPO)
11cfg.device = DEVICE
12policy = DiffusionPolicy.from_pretrained(REPO, config=cfg).to(DEVICE).eval()
13preprocessor, postprocessor = make_pre_post_processors(cfg, pretrained_path=REPO)
14
15# 2) Build an observation. Images are CHW float32 in [0,1] at 240×320.
16def make_obs():
17 return {
18 "observation.state": torch.zeros(141, dtype=torch.float32),
19 "observation.images.d405": torch.zeros(3, 240, 320, dtype=torch.float32),
20 "observation.images.zivid": torch.zeros(3, 240, 320, dtype=torch.float32),
21 }
22
23def to_batch(sample):
24 """Add a batch dim. The preprocessor moves to device + normalizes."""
25 return {k: (v.unsqueeze(0) if isinstance(v, torch.Tensor) else v) for k, v in sample.items()}
26
27# 3) Roll out n_action_steps actions (default 8) without re-running the diffusion head.
28# The policy caches an action chunk and emits one action per call to select_action.
29policy.reset()
30for t in range(cfg.n_action_steps):
31 obs = make_obs() # ← replace with real cameras + state
32 batch = preprocessor(to_batch(obs))
33 with torch.no_grad():
34 action_norm = policy.select_action(batch) # (1, 12) — normalized
35 action = postprocessor(action_norm.squeeze(0)).cpu().numpy() # (12,) — real units
36 print(f"t={t} action={action}")observation.state : (141,) float32observation.images.d405 / observation.images.zivid : (3, 240, 320) float32 in [0, 1]preprocessor handles batch-dim, device transfer, and MIN-MAX normalization for state/action.postprocessor reverses action MIN-MAX normalization on the CPU.examples/port_datasets/port_hookonly.py --cameras d405,zivid):1python examples/port_datasets/inference_diffusion_hookonly.py \
2 --checkpoint <local-or-hub-path>/Ngseo--rh56f1_diffusion_dinov2s_flowmatch_multicam_dr \
3 --dataset-root /path/to/lerobot_data/rh56f1_hookonly_multicam \
4 --frame-index 100policy.select_action, and prints
ground-truth vs. predicted actions for visual comparison.1python examples/port_datasets/port_hookonly.py \
2 --src /path/to/teleop_recorded_rh56f1_hookonly \
3 --out /path/to/lerobot_data/rh56f1_hookonly_multicam \
4 --robot rh56f1 \
5 --cameras d405,zivid \
6 --repo-id local/rh56f1_hookonly_multicam \
7 --streaming-encoding # ~6× faster than the default1lerobot-train \
2 --dataset.repo_id=local/rh56f1_hookonly_multicam \
3 --dataset.root=/path/to/lerobot_data/rh56f1_hookonly_multicam \
4 --dataset.image_transforms.enable=true \
5 --dataset.image_transforms.p_apply=0.5 \
6 --dataset.image_transforms.max_num_transforms=3 \
7 --dataset.image_transforms.domain_randomization=true \
8 --policy.type=diffusion \
9 --policy.vision_backbone=dinov2 \
10 --policy.dinov2_model_name=facebook/dinov2-small \
11 --policy.freeze_vision_backbone=true \
12 --policy.spatial_softmax_num_keypoints=64 \
13 --policy.noise_scheduler_type=FlowMatch \
14 --policy.num_inference_steps=1 \
15 --policy.device=cuda \
16 --policy.push_to_hub=false \
17 --output_dir=outputs/train/rh56f1_diffusion_dinov2s_flowmatch_multicam_dr \
18 --job_name=rh56f1_diffusion_dinov2s_flowmatch_multicam_dr \
19 --batch_size=64 --steps=200000 --eval_freq=0rh56f1_* matrix.