1# Run under Motus repository root
2import torch
3import yaml
4from pathlib import Path
5
6from models.motus import Motus, MotusConfig
7
8# Load config
9with open("configs/robotwin.yaml", "r") as f:
10 config = yaml.safe_load(f)
11
12# Create model config
13model_config = MotusConfig(
14 wan_checkpoint_path=config['model']['wan']['checkpoint_path'],
15 vae_path=config['model']['wan']['vae_path'],
16 wan_config_path=config['model']['wan']['config_path'],
17 video_precision=config['model']['wan']['precision'],
18 vlm_checkpoint_path=config['model']['vlm']['checkpoint_path'],
19 action_dim=config['common']['action_dim'],
20 action_state_dim=config['common']['state_dim'],
21 num_video_frames=config['common']['num_video_frames'],
22 video_height=config['common']['video_height'],
23 video_width=config['common']['video_width'],
24 load_pretrained_backbones=False, # Load from checkpoint
25)
26
27# Initialize and load checkpoint
28device = "cuda:0"
29model = Motus(model_config).to(device).eval()
30model.load_checkpoint("./pretrained_models/Motus", strict=False)
31
32# Run inference
33with torch.no_grad():
34 predicted_frames, predicted_actions = model.inference_step(
35 first_frame=first_frame_tensor, # [1, C, H, W]
36 state=state_tensor, # [1, state_dim]
37 num_inference_steps=20,
38 language_embeddings=t5_embeddings,
39 vlm_inputs=[vlm_inputs],
40 )
41
42# predicted_actions: [1, action_chunk_size, action_dim]
43action_chunk = predicted_actions.squeeze(0).cpu().numpy()
1@misc{bi2025motusunifiedlatentaction,
2 title={Motus: A Unified Latent Action World Model},
3 author={Hongzhe Bi and Hengkai Tan and Shenghao Xie and Zeyuan Wang and Shuhe Huang and Haitian Liu and Ruowen Zhao and Yao Feng and Chendong Xiang and Yinze Rong and Hongyan Zhao and Hanyu Liu and Zhizhong Su and Lei Ma and Hang Su and Jun Zhu},
4 year={2025},
5 eprint={2512.13030},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2512.13030},
9}