How adhithiya42/enhanced_pugeonet works
Purpose and entry points
PUGeo-Net Enhanced is a script-driven point-cloud upsampling demo focused on curved and hollow surfaces. Its primary entry points are pugeonet_enhanced/scripts/run_pipeline.py for the end-to-end workflow and pugeonet_enhanced/scripts/multi_rate_comparison.py for comparing output across upsampling factors.
Input geometry and sampling
Synthetic stress-test geometries—torus, sphere, hollow cylinder, and saddle—are generated in pugeonet_enhanced/src/shapes.py. pugeonet_enhanced/src/curvature_sampling.py estimates local curvature and performs curvature-aware farthest-point sampling, biasing sparse input points toward high-curvature regions before inference.
Neural upsampling model
pugeonet_enhanced/src/model.py contains EnhancedPUGeoNet, the central PyTorch model. The architecture uses adaptive neighborhood sizing, PCA-derived tangent frames, curvature-scaled seed offsets, tangent-projected displacement, and normal prediction. Its loss design combines geometric reconstruction with normal consistency and repulsion, targeting surface fidelity and prevention of hollow-shell leakage.
Inference and model initialization
Forward-pass orchestration is isolated in pugeonet_enhanced/src/inference.py. pugeonet_enhanced/src/pretrained.py optionally downloads and loads baseline PUGeo-Net weights; the pipeline remains runnable with freshly initialized weights when retrieval fails or is skipped. Runtime/device and sample-rate defaults are centralized in pugeonet_enhanced/src/config.py.
Surface correction and evaluation
Raw predicted points cross a post-inference boundary into pugeonet_enhanced/src/postprocess.py, where shell projection uses nearest-surface/KD-tree logic to correct interior drift on hollow objects. pugeonet_enhanced/src/metrics.py then evaluates reconstructed clouds with Chamfer distance, Hausdorff distance, and normal consistency metrics.
Outputs and visualization boundary
The pipeline writes point clouds through pugeonet_enhanced/src/io_utils.py and produces static figures via pugeonet_enhanced/src/visualization.py. Optional interactive inspection is separated into pugeonet_enhanced/src/interactive_viz.py, using Open3D and Plotly; CLI flags permit headless execution. Outputs are directed to the configured relative output location, normally ./output_enhanced/.
Runtime and external dependencies
The core runtime is Python with PyTorch, using CPU by default and optionally CUDA-compatible PyTorch. The project relies on scientific point-cloud operations plus KD-tree-based postprocessing, matplotlib for static artifacts, Open3D for desktop interaction, Plotly for browser-capable figures, and external checkpoint hosting accessed by pugeonet_enhanced/src/pretrained.py.
Main entry points: run_pipeline.py End-to-end pipeline · postprocess.py Shell projection · model.py EnhancedPUGeoNet · shapes.py Stress-test shapes
Components 17
Workflow entry points
- End-to-end pipeline · Runs generation, sampling, inference, correction, evaluation, and export.
pugeonet_enhanced/scripts/run_pipeline.py - Multi-rate comparison · Compares outputs across upsampling factors.
pugeonet_enhanced/scripts/multi_rate_comparison.py - Runtime defaults · Centralizes device and sample-rate defaults.
pugeonet_enhanced/src/config.py
Geometry and sampling
- Stress-test shapes · Generates torus, sphere, hollow cylinder, and saddle clouds.
pugeonet_enhanced/src/shapes.py - Curvature-aware sampling · Uses local curvature and farthest-point sampling to form sparse inputs.
pugeonet_enhanced/src/curvature_sampling.py
Upsampling runtime
- Checkpoint loader · Optionally retrieves and loads baseline PUGeo-Net weights.
pugeonet_enhanced/src/pretrained.py - External checkpoint hosting
- Forward-pass orchestration
pugeonet_enhanced/src/inference.py - EnhancedPUGeoNet · Produces dense points and normals from sparse point clouds.
pugeonet_enhanced/src/model.py - Surface-aware upsampling · Adaptive neighborhoods, PCA tangent frames, curvature-scaled seeds, and tangent-projected displacement.
pugeonet_enhanced/src/model.py - PyTorch runtime · CPU by default with optional CUDA execution.
Correction and outputs
- Shell projection · Corrects interior drift using nearest-surface and KD-tree logic.
pugeonet_enhanced/src/postprocess.py - Reconstruction metrics · Computes Chamfer, Hausdorff, and normal consistency metrics.
pugeonet_enhanced/src/metrics.py - Point-cloud export
pugeonet_enhanced/src/io_utils.py - Static visualization · Creates matplotlib artifacts.
pugeonet_enhanced/src/visualization.py - Interactive inspection · Uses Open3D and Plotly when enabled by CLI flags.
pugeonet_enhanced/src/interactive_viz.py - Output artifacts · Normally written under ./output_enhanced/.
Connections 20
- End-to-end pipeline → Runtime defaults: reads defaults
- End-to-end pipeline → Stress-test shapes: generates source cloud
- Stress-test shapes → Curvature-aware sampling: dense geometry
- Curvature-aware sampling → Forward-pass orchestration: sparse input cloud
- End-to-end pipeline → Checkpoint loader: initializes model
- Checkpoint loader → External checkpoint hosting: optional download
- Checkpoint loader → EnhancedPUGeoNet: loads weights when available
- Forward-pass orchestration → EnhancedPUGeoNet: executes forward pass
- EnhancedPUGeoNet → Surface-aware upsampling: implements
- EnhancedPUGeoNet → PyTorch runtime: runs on
- Forward-pass orchestration → Shell projection: raw predicted points
- Shell projection → Reconstruction metrics: corrected cloud
- Stress-test shapes → Reconstruction metrics: reference surface
- Shell projection → Point-cloud export: final cloud
- Point-cloud export → Output artifacts: writes point clouds
- Shell projection → Static visualization: visualizes result
- Static visualization → Output artifacts: writes figures
- End-to-end pipeline → Interactive inspection: optional CLI path
- Interactive inspection → Output artifacts: writes interactive artifacts
- Multi-rate comparison → End-to-end pipeline: varies upsampling rate