How sail-sg/treemeshgpt works
TreeMeshGPT turns a dense input mesh into a conditioned point cloud, then autoregressively generates an artistic mesh. Its training path tokenizes meshes into tree-ordered edge/target sequences, loads prepared samples, and optimizes the same model family. The graph preserves both workflows and the point-cloud encoder and transformer layers. Training-data preparation is documented and partially shown; relationships are limited to explicit calls, imports listed in the source index, and README statements.
Main entry points: inference.py Inference runner · train.py Training entry · treemeshgpt_train.py Training model · tokenizer.py Tree tokenizer
Components 19
Mesh generation
- Inference runner
inference.py - Mesh preparation
inference.py - Point sampling
fns.py
Training data
- Mesh utilities
fns.py - Tree tokenizer
tokenizer.py - Tokenization runner
train_create_pkl.py - Edge dataset
train_dataloader.py
Model internals
- Training model
model/treemeshgpt_train.py - Generation model
model/treemeshgpt_inference.py - Point cloud encoder
model/pc_encoder.py - Training transformer
model/custom_transformers_training.py - Inference transformer
model/custom_transformers_inference.py
Model training
- Training entry
train.py - Training loop
trainer.py
Other components
- User
- Input mesh
- Generated mesh
- Tokenized samples
- Model checkpoint
Connections 22
- User → Inference runner: runs
README.md - Input mesh → Inference runner: supplies
README.md - Inference runner → Mesh preparation: prepares
inference.py - Mesh preparation → Point sampling: samples points
inference.py - Inference runner → Generation model: generates with
inference.py - Inference runner → Model checkpoint: loads
- Inference runner → Generated mesh: writes
inference.py - User → Tokenization runner: runs
README.md - Tokenization runner → Tree tokenizer: invokes
train_create_pkl.py - Tree tokenizer → Mesh utilities: uses
tokenizer.py - Tree tokenizer → Tokenized samples: produces
tokenizer.py - Tokenized samples → Edge dataset: loads
train_dataloader.py - User → Training entry: runs
README.md - Training entry → Edge dataset: creates
train.py - Training entry → Training model: creates
train.py - Training entry → Training loop: configures
train.py - Training loop → Edge dataset: reads batches
- Training loop → Training model: optimizes
- Training model → Point cloud encoder: encodes point cloud
model/treemeshgpt_train.py - Training model → Training transformer: uses
model/treemeshgpt_train.py - Generation model → Point cloud encoder: encodes point cloud
model/treemeshgpt_inference.py - Generation model → Inference transformer: uses
model/treemeshgpt_inference.py