How junyu-liu-nate/spaghetti-training-code works
File structure
• Top-level scripts & configs:
• constants.py, options.py – global paths & hyperparameters
• make_data.py – data parsing & sampling pipeline
• train.py – model training entry point
• demo.py, shape_inversion_*.py – inference / inversion scripts
• debug.py – ad hoc troubleshooting
• data_loaders/: mesh dataset definition & sampling logic
• models/: core architecture implementations (DeepSDF, MLPs, transformers, occupancy modules), loss functions, utilities
• ui/: interactive front-end controllers, event handlers, rendering helpers, inference integration
• utils/: shared functions (file IO, mesh processing, evaluation, visualization, parsing)
README for additional insights
• External dependencies: ShapeNetCore.v2 dataset, Watertight Manifold binary
• High-level pipeline: download & preprocess meshes → sample points → train model → use trained model for editing/inference
• No built-in server or microservices; it’s a standalone research toolkit
a. Main components:
• External Resources (ShapeNet data, Manifold tool)
• Data Preprocessing & Sampling (make_data.py + data_loaders/)
• Model Training (train.py + models/)
• Model Checkpoint Store (trained .pt files)
• Interactive UI (ui/)
• Shared Utilities (utils/)
b. Relationships & data flow:
• Preprocessing → Data Loader → Training module
• Training → Checkpoint Store
• Inference → UI Controller → Render / Edit
• All components reference shared Utilities
c. Architectural patterns & principles:
• Layered pipeline: Data → Compute → Inference → Presentation
• Modular code organization (separate folders for data, model, UI, utils)
• Clear separation of concerns (preprocessing vs. training vs. UI)
• Extensibility: easy to swap models or sampling strategies
d. Key technologies & libraries:
• Python (entry scripts, modules)
• PyTorch (implied for deep models)
• NumPy / SciPy / mcubes (mesh sampling & reconstruction)
• Watertight Manifold (external binary)
• Custom UI toolkit (likely PyGame or OpenGL via ui/ modules)
Capturing essential architectural elements
• Don’t omit the shared utils folder—it underpins every stage