SIGGRAPH ASIA 2025

Img2CAD

Reverse Engineering 3D CAD Models from Images through VLM-Assisted Conditional Factorization

1Stanford University2NVIDIA3Peking University4DEVCOM Army Research Laboratory
Overview

From a single image to an editable CAD program

A CAD model is a program: a sequence of discrete commands (lines, arcs, circles, extrusions), each with continuous numbers (coordinates, angles, distances). Predicting both from pixels at once is hard. Img2CAD splits the job: a finetuned Llama 3.2 vision-language model writes the program's structure, naming each part, and TrAssembler, a transformer flow-matching model, fills in the numbers.

0.117

average Chamfer distance over chairs, tables and cabinets, 2.6× lower than the best baseline (0.311)

+17.9points

part-segmentation accuracy of the output over the best baseline, DeepCAD trained end to end

+19.0points

part-segmentation mIoU over the same baseline: the parts land where they should

4,574

ShapeNet chairs, tables and cabinets turned into CAD programs, released as a dataset

Img2CAD overview: a chair image goes to Llama, which writes a program skeleton for the backrest and legs with placeholder values; TrAssembler predicts the values by flow matching; OpenCascade builds the CAD model, which users can edit by asking GPT to add a curve to the backrest or make the legs taller.
Llama 3.2 predicts the parts and their command types; TrAssembler predicts the numbers; OpenCascade turns the program into a 3D model, which stays editable: ask for a curved backrest or taller legs and the program changes.
CAD programs

A CAD model is a short program

Img2CAD uses the sketch-and-extrude language of tools such as Fusion 360 and OpenCascade. A sketch is a closed loop of lines L: (x, y), arcs A: (x, y, α) and circles R: (x, y, r). An extrusion E turns it into a solid: three angles and an origin place the sketch, the last number is the distance, and the extrusion either joins the model or cuts it. Try it on a chair: the buttons change the program's structure, the sliders only change numbers.

Drag to rotate · hover a part in the program

Structure which commands

Attributes the numbers ·

A hand-written program in the paper's CAD language, built into a mesh in your browser (simple extrusion code, not OpenCascade). As in Img2CAD's programs, a comment names each part; changed numbers light up in orange.

Method

Structure from a VLM, numbers from a flow model

One model predicting a whole program mixes a combinatorial problem (which parts, which commands) with a continuous one (where, how big). Img2CAD conditionally factorizes it: the structure comes first, and the numbers are predicted given the structure.

  1. StructureA finetuned Llama 3.2 reads the image and writes each part's name and command types, with placeholders instead of numbers.
  2. Shared part namesNames such as backrest or leg stay consistent across shapes, so numbers can be learned across chairs whose structures differ.
  3. TrAssemblerPart transformers read DINOv2 image features; a global transformer relates the parts, with CLIP embeddings of their names; decoders output every number.
  4. Flow matching + symmetryNumbers are sampled from noise with GMFlow. At test time each step is nudged toward the mirror or rotational symmetry that GPT-4o reads off the image.
Two-stage pipeline: from a prompt and an input chair image, Llama writes the seat and backrest blocks with noise placeholders; TrAssembler, conditioned on the image, predicts the flow of the values over T steps, giving the output CAD model.
Llama 3.2 writes the structure; TrAssembler denoises the numbers in T flow-matching steps, conditioned on the image.
Two different chairs whose backrest blocks have almost the same numbers: lines at plus or minus 0.42 and 0.45 versus 0.34 and 0.43, and similar extrusion angles.
Different chairs, same part name, similar numbers: shared semantics make the numbers easier to learn.
A chair turned into a CAD model by Llama finetuned on full programs, with scattered parts, and by GPT-4V, with legs pointing up from a slab.
A VLM alone gets the parts but not the numbers: Llama 3.2 finetuned on full programs (left) and GPT-4V (right).

Watch TrAssembler sample a CAD model

Llama 3.2 fixes the structure, so the set of parts never changes; TrAssembler moves their numbers from random noise to the final shape. Real sampling runs on three ShapeNet test images.

Drag the slider or press play
Input imageInput
Noise
step 0 / 18
TrAssembler architecture: noisy attributes of each part (leg 1, leg 2, backrest) go through part transformer encoders with shared weights and cross-attention to DINOv2 image patch tokens; part tokens plus text embeddings of the semantic labels go through a global transformer encoder; part transformer decoders and MLPs predict the flow for every attribute.
TrAssembler: part encoders cross-attend to DINOv2 patch tokens; a global transformer relates the part tokens, which carry text embeddings of the part names; part decoders predict a flow for every number.
Results

More accurate shapes, with the right parts

Baselines: GPT-4o writing the whole program; Image-3D-CAD, an image-to-mesh model (LRM) followed by mesh-to-CAD (SECAD-Net); and DeepCAD finetuned on our data, with an image encoder aligned afterwards or trained end to end. Chamfer distance (CD) measures geometry; part segmentation of the output (accuracy and mIoU, %) checks that parts are where they should be.

All numbers
Image-to-CAD on the CAD-ified ShapeNet test sets. CD: Chamfer distance; Seg Acc and Seg mIoU (%): part segmentation of the output, compared with the ground-truth parts. Img2CAD is best on every column.
MethodChairTableCabinet
CD ↓Seg Acc ↑Seg mIoU ↑CD ↓Seg Acc ↑Seg mIoU ↑CD ↓Seg Acc ↑Seg mIoU ↑
GPT-4o0.380650.4934.960.367662.1641.990.380754.6647.65
Image-3D-CAD0.326649.0340.730.382833.7228.340.477559.6149.80
DeepCAD0.291470.4454.860.363360.2046.500.331062.7054.95
DeepCAD-End2End0.234677.0165.060.369867.3752.210.327960.5553.23
Img2CAD (ours)0.098491.8687.880.096693.8182.130.157373.0857.59
Qualitative comparison on eleven ShapeNet test images of chairs, tables and a bookshelf: GPT-4o, Image-3D-CAD, DeepCAD and DeepCAD-End2End give scattered or wrong parts, while Img2CAD gives complete, recognizable CAD models.
Test images (top) and the CAD models from each method. Img2CAD's are complete and match the input.
3D viewer

Turn the results around

Img2CAD's CAD models for ShapeNet test images, and for images rendered from random viewpoints. Pick an input and drag the model.

Input imageInput image
Img2CAD output Drag to rotate
Ablations

What each part of the design adds

Starting from Llama 3.2 predicting the full program, we add components one at a time; all variants after (i) use the VLM's structure. Semantic part labels and flow matching bring the largest gains; symmetry guidance mostly improves connectivity (fewer disconnected pieces, #SCC) and symmetry (SymChamfer), reported averaged over categories.

Ablation results on eleven test images: Llama end-to-end, flat TrAssembler and the hierarchical design without labels give broken shapes; adding semantic part info, flow matching and symmetry guidance gives progressively cleaner, more symmetric chairs, tables and a cabinet.
From top: input, then variants (i) to (vi). Each component makes the shapes more complete; symmetry guidance straightens the last details.
Generalization

Any viewpoint, and real photos

Trained on renders from a frontal viewpoint, Img2CAD stays accurate on renders from random viewpoints, thanks to the view-robust features of Llama, DINOv2 and CLIP. Averaged over the three categories, frontal → random view:

0.1174 → 0.1396

Chamfer distance

86.25 → 84.41

part-segmentation accuracy (%)

75.87 → 73.53

part-segmentation mIoU (%)

The CAD models of the same object from a frontal and from a random view are only 0.0282 apart in Chamfer distance.

Three objects, an armchair, a chair and a table, each seen from a normal and a random view, with Img2CAD's nearly identical CAD models below.
The same object from a normal and a random view gives nearly the same CAD model.
Chairs and tables seen from unusual angles, including from behind, and Img2CAD's CAD models.
More random-view inputs, including views from behind.

Real photos

Although TrAssembler is trained only on synthetic, CAD-ified ShapeNet models, Img2CAD also handles real images: indoor photos from Pix3D and product photos of furniture found online.

Eighteen Pix3D photos of armchairs, chairs, tables, a round table and bookcases, cluttered and partly occluded, with Img2CAD's CAD models below each.
Pix3D photos and Img2CAD's CAD models.
Online product photos of a leather lounge chair, two upholstered armchairs and a rustic console table, with Img2CAD's CAD models.
Product photos of furniture found online.

Why it transfers

The structure comes from a VLM trained on web-scale data, and TrAssembler sees the image through DINOv2 and the part names through CLIP. None of these depend on ShapeNet's rendering style, so real photos, with clutter, lighting and occlusion, still produce clean CAD programs.

Editing

Edit the CAD model with words

The output is a readable program with named parts, so a language model can edit it. Img2CAD recovers the program from a photo; GPT-4o is then asked for a change. “Turn it into a round table” changes the structure: the tabletop and shelf sketches go from lines to circles. “Make it longer” changes numbers, and GPT-4o moves the legs along with the tabletop. Try similar edits on the chair above.

Editing example: a photo of a coffee table becomes a CAD program with Img2CAD; GPT-4o, asked to turn it into a round table, replaces line commands with circles; asked to make it longer, it changes the x coordinates of the tabletop, shelf and legs, giving tables of length 1.0 to 2.0.
From one photo, several table variants: a structural edit (round table) and a continuous one (length from 1.0 to 2.0).
Dataset

Everyday objects as CAD programs

CAD datasets such as ABC are mostly mechanical parts. To train TrAssembler, we turned ShapeNet chairs, tables and cabinets (the categories with PartNet part labels) into sketch-and-extrude programs, semi-automatically:

  1. GPT-4V draftsFor a render with one part highlighted, GPT-4V writes the part's name and its lines, arcs and circles.
  2. Matched and fixedIts parts are matched to PartNet's (linear assignment), and their scale and position are corrected.
  3. Checked by handEvery model is reviewed; about 30% are kept. Splits follow PartNet.
1,026

chairs

3,243

tables

305

cabinets

Pairs of ShapeNet models and their CAD versions: chairs with a round hole and with slats, a trestle table and a round pedestal table, an open bookcase and a cabinet with a handle.
Each pair: the ShapeNet model (left) and its CAD program, rendered (right).
Limitations

Where it still fails

Failure cases: an armchair with a slatted side, a spindle-back chair and a bar stool lose or gain parts; a bench is mostly right; a table with crossed legs gets misplaced legs.
Failure cases: missing or invented parts, and misplaced parts on a rare, complex shape (right).
  • Structure errors. Llama 3.2 sometimes misses or invents parts. With the ground-truth structure instead, Chamfer distance drops from 0.1174 to 0.1032.
  • Rare shapes. TrAssembler can misplace parts on complex, long-tail designs.
  • Soft symmetry. Symmetry guidance nudges the numbers, so symmetry and connectivity improve but are not guaranteed.
  • Speed. Sampling with 32 Euler steps takes about 5 seconds per shape.
Code & data

Run it, train it

  • Code: finetuning and inference for Llama 3.2 (structure), training and evaluation for TrAssembler.
  • Models: Llama adapters, TrAssembler and part-segmentation checkpoints for chairs, tables and storage furniture.
  • Dataset: the CAD programs, renders, splits and symmetry labels (also on Google Drive, see the README).
git clone --recursive https://github.com/qq456cvb/Img2CAD.git
hf download qq456cvb/img2cad --local-dir data/ckpts/hf
hf download qq456cvb/img2cad-dataset --repo-type dataset --local-dir data
# stage 1: structure from images, with the finetuned Llama
python LlamaFT/infer.py --category chair --split test \
    --out_dir data/output/llamaft_h5/chair
# stage 2: numbers with TrAssembler, then the metrics
python TrAssembler/eval.py --model_dir data/ckpts/trassembler/chair --text_emb_retrieval
Abstract
Read the full abstract

Reverse engineering 3D computer-aided design (CAD) models from images is an important task for many downstream applications including interactive editing, manufacturing, architecture, robotics, etc. The difficulty of the task lies in vast representational disparities between the CAD output and the image input. CAD models are precise, programmatic constructs that involves sequential operations combining discrete command structure with continuous attributes – making it challenging to learn and optimize in an end-to-end fashion. Concurrently, input images introduce inherent challenges such as photometric variability and sensor noise, complicating the reverse engineering process. In this work, we introduce a novel approach that conditionally factorizes the task into two sub-problems. First, we leverage vision-language foundation models (VLMs), a finetuned Llama3.2, to predict the global discrete base structure with semantic information. Second, we propose TrAssembler that conditioned on the discrete structure with semantics predicts the continuous attribute values. To support the training of our TrAssembler, we further constructed an annotated CAD dataset of common objects from ShapeNet. Putting all together, our approach and data demonstrate significant first steps towards CAD-ifying images in the wild.

Cite

BibTeX

@inproceedings{you2025img2cad,
  title={Img2CAD: Reverse Engineering 3D CAD Models from Images through VLM-Assisted Conditional Factorization},
  author={You, Yang and Uy, Mikaela Angelina and Han, Jiaqi and Thomas, Rahul and Zhang, Haotong and Du, Yi and Chen, Hansheng and Engelmann, Francis and You, Suya and Guibas, Leonidas},
  booktitle={Proceedings of the SIGGRAPH Asia 2025 Conference Papers},
  pages={1--12},
  year={2025},
  doi={10.1145/3757377.3763891}
}