How mclemot/skeletonlearning works
Project type and purpose
• This is a research-oriented data-processing and machine-learning pipeline for 3D medial skeleton extraction.
• It ingests 3D meshes or point clouds, trains or loads implicit neural networks (INRs) to approximate a distance field, extracts a medial skeleton, and optionally renders results in Blender.
High-level components
A. Data
• Pretrained network snapshots in Pretrained/
B. I/O & Preprocessing
• io3d.py: loads meshes/point clouds, extracts points & normals
• geometry.py & distances.py: compute SDFs, distance transforms, normals processing
• tools.py & display.py: sampling, plotting helper functions
C. Neural Network Core
• nn.py: base network definitions
• siren_nn.py, igr_nn.py, build_*.py: wrappers to build variants (SIREN, IGR, SoftPlus, ReLU)
• pretrain.py: training loop that fits an INR to sampled surface data (PyTorch backend)
D. Skeleton Extraction
• build_coverage_skeleton.py, build_neural_skeleton.py, build_siren_neural_skeleton.py, build_igr_neural_skeleton.py: end-to-end scripts
• main.py: unified entry point (python main.py [input] [output])
E. Experiment & Reproducibility Scripts
• reproduce_*.py: orchestrate benchmarking, cube/torus fertility experiments, full render pipelines
F. Visualization & Rendering
• render.py: generates slices, point clouds, saves intermediate files
• BlenderToolbox/ & display.py: prepare Blender scenes and run headless renders
Interactions & Data Flow
• Data Input → I/O & Preprocessing → (Uniform) Sampling → INR Training (pretrain.py) → Model Checkpoint
• Checkpoint → Skeleton Extraction (main.py or build_*.py) → Skeletal .obj output
• compare/benchmark scripts call these building blocks in sequence and dump results under Comparisons/ and Results/
Architectural patterns & principles
• Pipeline architecture: clear separation between Data Ingest → Model Training → Inference → Visualization
• Modular ML components: interchangeable INR architectures (SIREN, SoftPlus, ReLU) under a shared interface
• Scriptable experiments: reproducibility through dedicated top-level scripts (reproduce_*.py)
Technologies & frameworks
• Python 3.10
• PyTorch for neural network training and inference
• NumPy, SciPy for numerical computations
• PyGEL3D, gudhi for geometry & topology processing
• Blender (bpy) for 3D renderings
• matplotlib, tabulate for plotting and CLI tabular outputs