Professional web-based GUI for humanoid robot training with motion imitation
⚠️ Note: This repository extends mjlab with a user-friendly training studio. The GUI and wrapper scripts were AI-generated on October 4, 2025.
- 🚀 Quick Start - Get running in 5 minutes
- 🔧 Installation Guide - Complete step-by-step setup
- 💻 System Requirements - Hardware specs & compatibility
Already installed? Continue below ↓
cd /path/to/mjlab
uv run --with gradio python app/gui/mjlab_gui.pyAccess at: http://localhost:7860
-
📊 Process Motion (Tab: Motion Imitation → Step 1)
- Select from 496 pre-made LAFAN1 motions
- Click "Process Motion"
- Watch video render in real-time (~30 seconds)
-
🎭 Train Robot (Tab: Motion Imitation → Step 2)
- Select your processed motion
- Click "Start Imitation Training"
- Wait ~4 hours (or use Quick preset for testing)
-
🎮 Visualize (Tab: Test & Visualize)
- Select your checkpoint
- Click "Start Visualization"
- See your robot perform the motion in 3D!
| Workflow | What You Get | Time |
|---|---|---|
| Velocity Tracking | Robot that walks, runs, turns, strafes | 2-3 hours |
| Motion Imitation | Robot that performs custom dance/sports moves | 4-5 hours |
| Checkpoint Visualization | Interactive 3D viewer of trained behaviors | Instant |
- Live Progress Dashboards - Real-time metrics, progress bars, ETA
- Auto-Refresh - No manual refresh needed, updates every 2 seconds
- Video Playback - Rendered motion previews with autoplay
- Embedded 3D Viewer - Viser iframe loads directly in dashboard
- One-Click Workflows - Preset configurations for beginners
- 496 Motion Library - LAFAN1 dataset browser with search
- ✅ No Cloud Required - Fully functional offline
- ✅ No WandB Account - Bypasses cloud dependencies gracefully
- ✅ Organized Outputs - Timestamped folders with all artifacts
- ✅ Non-Invasive - Zero modifications to core mjlab code
Train a robot to follow movement commands like a video game character:
- Go to "Velocity Tracking" tab
- Choose preset:
- ⚡ Quick (30 min) - Basic locomotion test
- 📊 Standard (2 hours) - Good walking behavior
- 🔬 Full (8 hours) - Publication-quality results
- Click "Start Training"
- Monitor progress:
- Iteration counter (e.g., 5000/30000)
- Mean reward (target: ~100+)
- Episode length (target: ~500 steps)
- Training speed (~200-400 it/s)
- ETA to completion
What the robot learns:
- Walk forward/backward (-1.0 to +1.0 m/s)
- Strafe left/right (-0.5 to +0.5 m/s)
- Turn in place (-1.0 to +1.0 rad/s)
- Smooth transitions between gaits
- Stable standing
From LAFAN1 Library:
- Navigate to "Motion Imitation" → "Step 1: Dataset Browser"
- Select robot type (G1, GO1, etc.)
- Browse 496 motions (dance, sports, locomotion, interactions)
- Click a motion to see preview chart
- Click "Process Motion"
- Watch live progress:
- Frame interpolation (30 FPS → 50 FPS)
- MuJoCo simulation
- Video rendering with moviepy
- NPZ file saving
- Output:
app/datasets/processed/<motion>_<timestamp>/motion.npz- Training datamotion.mp4- Preview video (auto-plays)processing.log- Complete log
From Custom CSV:
- Click "Upload Custom CSV"
- Select your motion file (columns = joint names, rows = frames)
- Motion name auto-fills from filename
- Continue with processing...
CSV Format:
joint_1,joint_2,joint_3,...,joint_29
0.1,0.2,0.3,...,0.0
0.12,0.21,0.31,...,0.01
...- Select processed NPZ from dropdown
- Configure training (or use defaults):
- Parallel Environments: 1024 (fewer for motion imitation)
- Max Iterations: 30,000 (~4 hours)
- Save Interval: 500 (checkpoint frequency)
- Learning Rate: 0.0005
- Click "Start Imitation Training"
- Monitor dashboard:
- Iteration progress
- Mean reward (track improvement)
- Episode length
- Time elapsed / ETA
- Training speed
- Output:
logs/rsl_rl/g1_tracking/<timestamp>_<motion_name>/model_0.pt,model_500.pt, ... - Checkpointsparams/env.yaml- Contains motion file pathsummaries/- TensorBoard logs
- Go to "Test & Visualize" tab
- Checkpoint auto-selects (most recent)
- Task auto-detects (Tracking vs Velocity)
- Click "Start Visualization"
- Wait ~15 seconds watching live log:
- ✅ Loading checkpoint
- 🎭 Found motion file from training config
- 🏗️ Creating environment
- 🧠 Loading policy
- 🌐 Starting Viser viewer
- 3D viewer auto-loads in iframe!
- Interact with robot:
- Rotate camera with mouse
- Watch motion loop continuously
- See learned behavior quality
┌─────────────────────────────────────────────────────────────┐
│ 🤖 mjlab Training Studio │
│ Professional robotics training with guided workflows │
├─────────────────────────────────────────────────────────────┤
│ ⚙️ Global Settings │ Tabs: → → → → → │
│ Device: cuda:0 ▼ │ │
├─────────────────────────────────────────────────────────────┤
│ │
│ Tab Content Area: │
│ ┌───────────────────────┬─────────────────────────────┐ │
│ │ Controls & │ Live Dashboard / │ │
│ │ Configuration │ Output Display │ │
│ │ │ │ │
│ │ - Dropdowns │ - Progress Metrics │ │
│ │ - Sliders │ - Status Messages │ │
│ │ - Buttons │ - Video/3D Viewer │ │
│ │ - Presets │ - Collapsible Logs │ │
│ └───────────────────────┴─────────────────────────────┘ │
│ │
│ Documentation & Tips (below each tab) │
└─────────────────────────────────────────────────────────────┘
- 📊 Progress Bars - Visual completion status
- ⏱️ Live Timers - Real-time ETA calculations
- 📋 Collapsible Logs - Detailed output when needed
- 📋 Copy Buttons - One-click log copying
- 🔄 Auto-Refresh - No manual refresh needed
- 🎬 Video Players - Auto-play with loop
- 🌐 Embedded iframes - 3D viewers in dashboard
app/
├── gui/mjlab_gui.py # Main Gradio dashboard (2,316 lines)
├── scripts/
│ ├── process_motion_local.py # Motion processing wrapper
│ ├── train_motion_local.py # Training wrapper
│ └── visualize_checkpoint.py # Visualization script
└── datasets/
├── LAFAN1_Retargeting_Dataset/ # 496 pre-made motions
└── processed/ # Your processed outputs
└── <motion>_<timestamp>/
├── motion.npz
├── motion.mp4
└── processing.log
Non-Invasive Wrapper Pattern:
- Core
mjlablibrary remains unchanged - Wrapper scripts handle WandB bypass via monkey-patching
- All application code in separate
app/directory
Local-First Development:
- No cloud accounts required
- All data stored locally in organized folders
- WandB integration preserved for users who want it
World-Class UX:
- Live progress tracking everywhere
- Auto-detection and smart defaults
- Clear error messages with solutions
- Professional visual design
The core mjlab scripts expect WandB for artifact management. Our wrappers provide local alternatives:
Motion Processing:
# Patches wandb.init to return mock run object
# Allows video rendering to complete
# Copies files to permanent storageTraining:
# Patches wandb.Api.artifact to return local paths
# Uses local NPZ files instead of downloads
# Adds motion names to checkpoint folders- ProcessManager class - Streams subprocess output in real-time
- Unbuffered I/O -
PYTHONUNBUFFERED=1for immediate logging - Thread-safe queues - Background streaming without blocking
- Graceful termination - Clean shutdown on Stop button
For checkpoint visualization, motion files are found via:
- Primary: Read from
params/env.yaml(saved during training) - Fallback: Parse motion name from folder name
- Validation: Check file exists before loading
app/datasets/processed/
└── dance2_subject5_2025-10-04_01-17-13/
├── motion.npz # Training data (joint pos/vel, body states)
├── motion.mp4 # Rendered preview video
└── processing.log # Complete processing log
logs/rsl_rl/
├── g1_velocity/
│ └── 2025-10-03_23-55-36/
│ ├── model_0.pt, model_500.pt, ...
│ ├── params/
│ │ ├── env.yaml # Environment config
│ │ └── agent.yaml # Training hyperparameters
│ └── summaries/ # TensorBoard logs
│
└── g1_tracking/
└── 2025-10-04_02-45-09_dance2_subject5_2025-10-04_01-17-13/
├── model_0.pt, model_500.pt, ...
├── params/
│ └── env.yaml # ← Contains motion_file path!
└── summaries/
Note: Tracking checkpoints include motion name in folder for easy identification.
Start Here: Tab 1 → "Getting Started"
- Overview of the workflow
- Quick start guide
- Recommended first project
First Project: Velocity Tracking (30 minutes)
- Click "Velocity Tracking" tab
- Click "⚡ Quick" preset
- Click "Start Training"
- Wait 30 minutes
- Visualize your walking robot!
Motion Imitation:
- Requires understanding of:
- Motion retargeting concepts
- Joint angle representations
- Imitation learning theory
Custom Motions:
- CSV format requirements
- Joint naming conventions
- FPS and interpolation settings
Hyperparameter Tuning:
- Learning rate effects
- Batch size vs convergence
- Reward shaping strategies
- mjlab Core: See
README.mjlab.mdfor original framework docs - Application Layer: See
app/README.mdfor technical details - Session History: See
.cursor/gui-development-session.mdfor development context - API Reference: See
docs/api/for configuration details
# Kill any existing instances
pkill -f mjlab_gui.py
# Restart
cd /home/mitch/Repositories/mjlab
uv run --with gradio python app/gui/mjlab_gui.py# Kill zombie processes
pkill -9 -f visualize_checkpoint.py
# Restart from GUI
# Or hard-refresh browser: Ctrl+Shift+RSolution: Wait 15 seconds for Viser server to start, then click "🔄 Load Viewer"
Alternative: Open http://localhost:8080 in a new browser tab
Check:
- NPZ file exists in
app/datasets/processed/ - GPU is available:
nvidia-smi - No other training running:
ps aux | grep train
Common Fix:
- Restart dashboard (kills existing processes)
- Check logs in collapsible accordion
Check:
- "Render video" toggle is ON
- Disk space available:
df -h /tmp - moviepy installed:
uv run python -c "import moviepy"
Note: Video rendering adds ~10-20 seconds to processing
Don't worry! Server-side validation auto-corrects the task based on checkpoint path.
If still broken: Hard-refresh browser (Ctrl+Shift+R)
| Component | Minimum | Recommended | Our Setup |
|---|---|---|---|
| GPU | NVIDIA GTX 1080 (8GB) | RTX 3090 (24GB) | RTX 6000 Ada (48GB) |
| RAM | 16 GB | 32 GB | 64+ GB |
| CPU | 4 cores | 8+ cores | 16+ cores |
| Storage | 50 GB | 100 GB | 500 GB+ |
| Task | Iterations | Time | GPU Usage |
|---|---|---|---|
| Velocity (Quick) | 5,000 | 30 min | 80-95% |
| Velocity (Standard) | 15,000 | 2 hours | 80-95% |
| Motion Imitation | 30,000 | 4 hours | 80-95% |
| Motion Length | Frames | Process Time | Video Render |
|---|---|---|---|
| Short | 1,000 | 3 sec | 5 sec |
| Medium | 3,000 | 10 sec | 10 sec |
| Long | 6,000+ | 20 sec | 20 sec |
Current (Single GPU):
- Training uses
cuda:0only - Second GPU (
cuda:1) is idle - GPU-bound during simulation (80-95%)
- CPU-bound during policy updates (20-40% GPU)
To use both GPUs: Run two separate training jobs manually:
# Terminal 1
uv run train <task> --device cuda:0 ...
# Terminal 2
uv run train <task> --device cuda:1 ...[Placeholder for screenshot of main dashboard]
[Placeholder for screenshot of processing with live progress]
[Placeholder for screenshot of embedded Viser viewer]
[Placeholder for screenshot of training dashboard]
Launch TensorBoard for detailed training metrics:
# From GUI: Click "Launch TensorBoard" button
# Or manually:
uv run tensorboard --logdir logs/rsl_rl --port 6006Access at: http://localhost:6006
View:
- Reward curves over time
- Policy loss and value loss
- Learning rate schedules
- Episode length trends
Your CSV should have:
- Header row: Joint names (29 joints for Unitree G1)
- Data rows: Joint angles in radians
- Frame rate: Any (will interpolate to 50 FPS)
Example:
left_hip_pitch,left_hip_roll,left_hip_yaw,...
0.1,0.05,0.0,...
0.12,0.06,0.01,...Joint names: See src/mjlab/asset_zoo/robots/unitree_g1/g1_constants.py
Automatic Naming:
- Velocity:
logs/rsl_rl/g1_velocity/<timestamp>/ - Tracking:
logs/rsl_rl/g1_tracking/<timestamp>_<motion_name>/
Motion name in folder makes it easy to identify which motion was trained!
View checkpoints:
ls -lR logs/rsl_rl/See original repository: https://github.com/mujocolab/mjlab
This repository (mjlab-gui) focuses on the application layer:
Areas for contribution:
- Additional GUI tabs (terrain generation, hyperparameter tuning)
- New motion processing features
- Improved visualization tools
- Better error handling and recovery
- Performance optimizations
- Documentation improvements
Development setup:
git clone https://github.com/experientialtech/mjlab-gui.git
cd mjlab-gui
# Follow mjlab installation instructions
# Then launch GUI as shown aboveThis repository contains:
- mjlab core library - See
LICENSE(original mjlab license) - Training Studio GUI - AI-generated code (October 4, 2025)
- See individual file headers for disclaimers
- Review before production use
- mjlab Framework: https://github.com/mujocolab/mjlab
- LAFAN1 Dataset: Retargeted for Unitree robots
- Viser: Interactive 3D visualization
- RSL-RL: RL training algorithms
- MuJoCo: Physics simulation
- Warp: GPU acceleration
GUI Development:
- AI Assistant: Claude Sonnet 4.5 (via Cursor)
- Developer: Mitch (experientialtech)
- Date: October 4, 2025
- Session: ~3 hours of iterative development
See Troubleshooting section above, or check:
.cursor/gui-development-session.md- Full technical contextapp/README.md- Application architecture- Tab 6 in GUI: "Help & Examples"
- Check the collapsible logs in the GUI
- Review the session development notes
- Open an issue on GitHub
- Check original mjlab documentation
- Web-based training studio
- Motion imitation workflow
- Local WandB bypass
- Embedded 3D visualization
- Live progress dashboards
- LAFAN1 dataset integration
- Comprehensive documentation
- Multi-GPU training support
- Checkpoint comparison tool
- Motion blending/sequencing
- ONNX export integration
- Custom terrain generation UI
- Real robot deployment wizard
- Training hyperparameter auto-tuning
- Cloud deployment option
- Multi-user support
- Motion sharing marketplace
- Benchmark leaderboards
- Mobile app for monitoring
- Integration with physical Unitree robots
- Original mjlab: https://github.com/mujocolab/mjlab
- MuJoCo: https://mujoco.org/
- Gradio: https://gradio.app/
- Viser: https://viser.studio/
- LAFAN1: https://github.com/ubisoft/ubisoft-laforge-animation-dataset
Built with ❤️ and 🤖 AI
Last Updated: October 4, 2025
Version: 1.0.0
For the original mjlab README, see README.mjlab.md