Reachy Mimic — text to Reachy Mini motion, learned from pet videos
A 15.3M-parameter rectified-flow Transformer that turns a text prompt (any language) into a 25 Hz trajectory for the Reachy Mini desk robot: head pose (x, y, z, roll, pitch, yaw), both antennas and body yaw. It was trained on 13,505 motion clips, most of them retargeted from public videos of dogs, cats and parrots, so the moves look like a pet rather than a machine.
- Demo Space: https://huggingface.co/spaces/rancheng222/reachy_mimic
- Project page (data funnel, charts, videos): https://huggingface.co/spaces/rancheng222/reachy_mimic_page
- Dataset: https://huggingface.co/datasets/rancheng222/reachy_mimic
Quick start
pip install torch transformers scipy numpy huggingface_hub
from huggingface_hub import hf_hub_download
import importlib.util, json
spec = importlib.util.spec_from_file_location("reachy_mimic", hf_hub_download("rancheng222/reachy_mimic", "reachy_mimic.py"))
rm = importlib.util.module_from_spec(spec); spec.loader.exec_module(rm)
g = rm.Generator() # downloads ema.pt, CPU or CUDA
ch = g("tilt head curiously to the left", duration=4.0, seed=0) # numpy [T, 9] at 25 Hz
move = rm.to_recorded_move(ch, description="curious tilt") # Reachy Mini RecordedMove dict (50 Hz)
json.dump(move, open("curious_tilt.json", "w"))
Play it on a robot (or the simulator daemon) with the official SDK:
from reachy_mini import ReachyMini
from reachy_mini.motion.recorded_move import RecordedMove
ReachyMini().play_move(RecordedMove(json.load(open("curious_tilt.json"))))
Prompts were evaluated in English, Chinese, Japanese, Spanish, French, German, Korean, Russian and Arabic; the multilingual MPNet text encoder covers 50+ languages.
Files
| file | what |
|---|---|
ema.pt | EMA weights, channel mean/std, model config (torch.load(..., weights_only=False)) |
reachy_mimic.py | standalone inference: T2M, TextEnc, sample, Generator, to_recorded_move, safety clamp |
config.json | architecture and normalisation constants |
eval.json, log.json | the evaluation below and the training curve |
Output format
| channel | unit | convention |
|---|---|---|
| x, y, z | mm | head translation; x forward, y left, z up |
| roll, pitch, yaw | deg | +roll lowers the robot's right side, +pitch nose down, +yaw turns left |
| antR, antL | rad | 0 = perked straight up; antR negative / antL positive = folded back |
| body_yaw | rad | base rotation, +left |
to_recorded_move clamps every channel to the official move-corpus envelope (roll ±34°, pitch ±29°, yaw −54..50°, x ±22 mm, y ±25 mm, z −33..25 mm, body ±0.75 rad), resamples to 50 Hz and eases in and out of the neutral pose so moves can be chained.
The training pipeline additionally projects every clip and every generated move through a MuJoCo world model (reachability, self-collision, joint speed); that check needs the full reachy_mini package and is not part of this module.
Model
- Rectified-flow (conditional flow matching) velocity network: 8-layer Transformer, d = 384, 6 heads, sequence = [condition token, 64 text tokens, up to 200 motion tokens].
- Text: frozen
sentence-transformers/paraphrase-multilingual-mpnet-base-v2token embeddings + masked mean pool. - Classifier-free guidance (default 3.0), 50 Euler steps, length embedding, optional motion-prefix conditioning (
prefix=) for continuation and improvisation. - Training: 18,000 steps, batch 64, AdamW, mirror and time-warp augmentation, exact direction-grounded auto-captions in 9 languages (multilingual captions sampled 40% of the time), 36 min on one RTX 4090.
Evaluation
Directional controllability: 13 prompt tests (one channel and expected sign each), 12 seeds, 9 languages, cfg 3.0, world-model repair applied before scoring. Chance ≈ 0.5.
| version | overall | en | zh | ja | es | fr | de | ko | ru | ar |
|---|---|---|---|---|---|---|---|---|---|---|
| v4 | 0.51 | 0.67 | 0.53 | 0.51 | 0.53 | 0.48 | 0.44 | 0.47 | 0.48 | 0.51 |
| v5c | 0.63 | 0.71 | 0.61 | 0.56 | 0.61 | 0.68 | 0.62 | 0.62 | 0.60 | 0.63 |
| v5b (this checkpoint) | 0.69 | 0.71 | 0.66 | 0.65 | 0.71 | 0.72 | 0.71 | 0.68 | 0.71 | 0.72 |
| v6 (+ synthesized parrot clips) | 0.61 | 0.63 | 0.56 | 0.58 | 0.63 | 0.67 | 0.62 | 0.62 | 0.59 | 0.60 |
| v7 (+ tracked parrot clips) | 0.62 | 0.64 | 0.59 | 0.59 | 0.63 | 0.65 | 0.63 | 0.63 | 0.60 | 0.60 |
Per test (9-language mean): turn left 0.70, turn right 0.83, look up 0.50, look down 0.66, tilt right 0.68, tilt left 0.81, antenna droop 1.00 / 1.00, antennas alert 0.38, lean forward 0.50, startled lean-back 0.19, body left 0.89, body right 0.90. Rhythm test (share of 1–4 Hz power ≥ 0.25 on bob/nod prompts): 0.19 for this checkpoint, 0.36 for v7, which learned the parrot head-bob but lost directional accuracy. Details and charts on the project page.
Training data
13,505 clips, 1,238 min: 10,101 verified animal clips (pose-tracked dogs/cats, Grounding-DINO head tracks for parrots, VLM keyframe timelines for animated footage), 2,347 community gallery moves, 370 InterPet4D dog skeletons, 300 MotionHiFlow retargeted clips, 300 frontier-LLM keyframe clips, 87 official emotions-library moves. Captions by claude-haiku-5-5 from 8-frame contact sheets, translated into 12 languages. The open-licensed 8,745-clip subset is published as the dataset above.
Limitations
- Weak prompts: "look up", "alert antennas", the startled lean-back; roll amplitude is modest because the safety projection shrinks it.
- Trained in simulation conventions; on a real unit keep the daemon's collision checking on.
- The model generates head/antenna/body motion only, no sound, no gaze control, no reaction to the camera.