Views
No views yet
x, y, z, roll, pitch, yaw, gripper). These actions should be unnormalized and integrated by our Adaptive Action Ensemble(Optional). Unnormalization and ensemble depend on the dataset statistics.1# Please clone and install dependencies in our repo
2# Install minimal dependencies (`torch`, `transformers`, `timm`, `tokenizers`, ...)
3
4from PIL import Image
5from vla import load_vla
6import torch
7
8model = load_vla(
9 'CogACT/CogACT-Base',
10 load_for_training=False,
11 action_model_type='DiT-B',
12 future_action_window_size=15,
13 )
14# about 30G Memory in fp32;
15
16# (Optional) use "model.vlm = model.vlm.to(torch.bfloat16)" to load vlm in bf16
17
18model.to('cuda:0').eval()
19
20image: Image.Image = <input_your_image>
21prompt = "move sponge near apple" # input your prompt
22
23# Predict Action (7-DoF; un-normalize for RT-1 google robot data, i.e. fractal20220817_data)
24actions, _ = model.predict_action(
25 image,
26 prompt,
27 unnorm_key='fractal20220817_data', # input your unnorm_key of dataset
28 cfg_scale = 1.5, # cfg from 1.5 to 7 also performs well
29 use_ddim = True, # use DDIM sampling
30 num_ddim_steps = 10, # number of steps for DDIM sampling
31 )
32
33# results in 7-DoF actions of 16 steps with shape [16, 7]1@article{li2024cogact,
2 title={CogACT: A Foundational Vision-Language-Action Model for Synergizing Cognition and Action in Robotic Manipulation},
3 author={Li, Qixiu and Liang, Yaobo and Wang, Zeyu and Luo, Lin and Chen, Xi and Liao, Mozheng and Wei, Fangyun and Deng, Yu and Xu, Sicheng and Zhang, Yizhong and others},
4 journal={arXiv preprint arXiv:2411.19650},
5 year={2024}
6}