SIGGRAPH Asia 2026 (ACM Transactions on Graphics)
Honghao Xu · Hao Wang · Xiang Liu · Juzhan Xu · Manfred Lau · Kai Xu · Ruizhen Hu
Install the environment with Conda:
git clone https://github.com/Daisy-1227/TempFit.git
cd TempFit
conda create -n tempfit python=3.10 pip -y
conda activate tempfit
bash environment/install.sh --condaThe installation script downloads the required packages and sets up the environment.
The dataset and pretrained weights are available on Hugging Face.
Request dataset access on its Hugging Face page. Once approved, run these commands from the repository root:
pip install -U huggingface_hub
hf auth login
hf download Daisy-1227/TempFit TempFit.zip TempFit.zip.sha256 --repo-type dataset --local-dir downloads
(cd downloads && sha256sum -c TempFit.zip.sha256)
python -m zipfile -e downloads/TempFit.zip tempfit-data
cp -r tempfit-data/data tempfit-data/splits .
hf download Daisy-1227/TempFit --include "tempfit-scratch/*" --local-dir checkpointsThe resulting layout is:
TempFit/
├── data/industrycad/
│ ├── template-v1/
│ │ ├── train/
│ │ │ ├── svg/
│ │ │ └── gt/
│ │ ├── test/
│ │ │ ├── svg/
│ │ │ └── gt/
│ │ ├── primitive_mapping.json
│ │ ├── invalid_scene.txt
│ │ └── DATA_MANIFEST.json
│ └── resources/
│ ├── templates/
│ ├── model_mapping.json
│ ├── donor/
│ └── invalid_train.txt
├── splits/
│ ├── train.json
│ └── test.json
└── checkpoints/
└── tempfit-scratch/
├── model.safetensors
└── model.json
The default configurations use this layout. To store the data elsewhere, update paths in configs/train.yaml and configs/inference.yaml; relative paths are resolved from the configuration file's directory. Keep model.json alongside model.safetensors.
Run autoregressive inference on the test set:
python inference.py --config configs/inference.yaml --checkpoint checkpoints/tempfit-scratch/model.safetensors --output_dir outputs/tempfit-testPredictions and metrics are saved to outputs/tempfit-test/, including predictions.json, instances.json, SUMMARY.json, and per-scene outputs in results_val/.
To train from scratch on 8 GPUs:
accelerate launch --multi_gpu --num_processes 8 --mixed_precision bf16 train.py --config configs/train.yaml --output_dir outputs/tempfit-trainTo train from scratch on a single GPU:
python train.py --config configs/train.yaml --output_dir outputs/tempfit-train-singleThe process count is detected at launch. By default, each GPU uses a batch size of 4, and gradient accumulation adjusts to keep the global effective batch size at 128: 4 steps on 8 GPUs, 8 on 4 GPUs, or 32 on a single GPU. Use --batch_size and --grad_accum_every to set these explicitly. Both launch methods use BF16.
To resume training from a saved checkpoint:
accelerate launch --multi_gpu --num_processes 8 --mixed_precision bf16 train.py --config configs/train.yaml --resume outputs/tempfit-train/latest.pt --output_dir outputs/tempfit-trainTo initialize a new training run from the released weights:
accelerate launch --multi_gpu --num_processes 8 --mixed_precision bf16 train.py --config configs/train.yaml --pretrained checkpoints/tempfit-scratch/model.safetensors --output_dir outputs/tempfit-finetune--pretrained loads model weights for a new run. --resume restores the model, optimizer, scheduler, and training progress with the same process count and training settings. Both options also work with the single-GPU python train.py command. Training settings are defined in configs/train.yaml.
If you have any question about this repo, feel free to drop me an email littledaisy20001227@gmail.com
If you find TempFit useful in your research, please cite our paper:
@article{xu2026tempfit,
title={TempFit: Panoptic Symbol Spotting via Template Fitting},
author={Honghao Xu and Hao Wang and Xiang Liu and Juzhan Xu and Manfred Lau and Kai Xu and Ruizhen Hu},
journal={ACM Transactions on Graphics},
year={2026},
url={https://arxiv.org/abs/2610.17776}
}The project's original code and model weights are released under the MIT License. The dataset is released under CC BY-NC 4.0. See the project license and third-party notices for details.
We thank the authors of Pointcept, Point Transformer V3, SymPointV2, VecFormer, and PrimitiveAnything for sharing their code and research.
