Real2Code: Reconstruct Articulated Objects via Code Generation
Zhao Mandi, Yijia Weng, Dominik Bauer, Shuran Song
TL;DR
Real2Code tackles the challenge of reconstructing richly articulated objects from RGB observations by reframing joint prediction as executable code generation conditioned on compact OBB abstractions. The method splits the problem into part-level geometry reconstruction (via kinematics-aware segmentation and shape completion) and LLM-driven articulation prediction, fine-tuned to output MuJoCo-executable Python code. Key innovations include OBB-based input, test-time view-consistent prompts, and LoRA-fine-tuned CodeLlama for scalable, multi-part articulation with up to 10 joints. Experiments on PartNet-Mobility demonstrate state-of-the-art reconstruction and articulation accuracy, with qualitative real-world results showing robust generalization from RGB cues. This approach enables rapid generation of simulatable digital twins for robotics and VR/AR applications.
Abstract
We present Real2Code, a novel approach to reconstructing articulated objects via code generation. Given visual observations of an object, we first reconstruct its part geometry using an image segmentation model and a shape completion model. We then represent the object parts with oriented bounding boxes, which are input to a fine-tuned large language model (LLM) to predict joint articulation as code. By leveraging pre-trained vision and language models, our approach scales elegantly with the number of articulated parts, and generalizes from synthetic training data to real world objects in unstructured environments. Experimental results demonstrate that Real2Code significantly outperforms previous state-of-the-art in reconstruction accuracy, and is the first approach to extrapolate beyond objects' structural complexity in the training set, and reconstructs objects with up to 10 articulated parts. When incorporated with a stereo reconstruction model, Real2Code also generalizes to real world objects from a handful of multi-view RGB images, without the need for depth or camera information.
