TempFit Dataset
TempFit contains industrial CAD scenes represented as line segments, with instance annotations for semantic class, primitive template, translation, rotation, scale, and reflection. It supports research on template-based CAD scene understanding and reconstruction.
Dataset contents
| Split | Scenes | Annotated instances | Line segments |
|---|---|---|---|
train |
2,112 | 27,774 | 69,612,738 |
test |
494 | 5,884 | 13,523,488 |
The dataset includes 23 semantic classes, 76 primitive templates, and a training augmentation donor bank with 21,085 instances from 1,985 training scenes. The complete package occupies approximately 12.33 GB before compression.
Instance counts describe the stored annotations; evaluation applies the TempFit loader's range and validity filters.
Directory structure
data/industrycad/
βββ template-v1/
β βββ train/
β β βββ svg/ # Input line-segment JSON
β β βββ gt/ # Instance annotations
β βββ test/
β β βββ svg/
β β βββ gt/
β βββ primitive_mapping.json
β βββ invalid_scene.txt
β βββ DATA_MANIFEST.json
βββ resources/
βββ templates/ # 0.json ... 75.json
βββ model_mapping.json
βββ donor/
βββ invalid_train.txt
splits/
βββ train.json # Training filenames
βββ test.json # Test filenames
Scene filenames follow PPPP-BBBB.json: PPPP identifies the parent drawing and BBBB identifies its block. Input and GT files share the same basename.
Data format
Each input JSON stores line endpoints, RGB colors, widths, layer indices, and source primitive groups. Each GT JSON is a list of instances with template and geometric attributes.
| Field | Meaning |
|---|---|
Input coords |
Line endpoints [x1, y1, x2, y2] in drawing coordinates |
Input primitive_ids |
Indices into source CAD primitive groups |
Input instance_ids |
Source-group instance references; i refers to GT[i-1] |
Input semantic_ids |
Source-group semantic class IDs, 0β22 |
GT semantic_id |
Semantic class ID, 0β22 |
GT template_id |
Template ID, 0β75 |
GT translation |
Translation in the centered scene frame |
GT rotate |
Rotation angle in degrees |
GT scale |
Template scale factors [sx, sy] |
GT flip |
Whether to mirror template x before scaling and rotation |
All input lines belong to annotated instances. Input and GT semantic class IDs both range from 0 to 22. Input primitive_ids identify source geometry groups, while GT template_id identifies a template.
To obtain the semantic class for each line segment:
line_semantic_ids = [scene["semantic_ids"][p] for p in scene["primitive_ids"]]
line_semantic_ids[i] is the class ID (0β22) of coords[i].
See SCHEMA.txt for the complete format and coordinate transformation, and LABELS.json for semantic-to-template IDs.
Download
Request access on Hugging Face. Once access is granted, download and extract the dataset:
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
python tempfit-data/verify_package.py
The archive contains the directory structure shown above.
Usage
Place data/ and splits/ from tempfit-data/ at the root of a TempFit checkout. The training and inference configurations use the paths shown above.
To read a scene directly:
import json
from pathlib import Path
root = Path("data/industrycad/template-v1")
test_names = json.loads(Path("splits/test.json").read_text())
name = test_names[0]
scene = json.loads((root / "test" / "svg" / name).read_text())
instances = json.loads((root / "test" / "gt" / name).read_text())
To verify the downloaded package:
python verify_package.py
License and access
The dataset is licensed under CC BY-NC 4.0. You may share and adapt it for non-commercial purposes with attribution. See LICENSE for the full terms.
To download the dataset from Hugging Face, complete the access request form.
- Downloads last month
- -