How alexandrebinninger/sens works
Project Type and Purpose
• It supports two modes of operation:
• CLI inference (run.py) for offline sketch→mesh conversion
• It also provides a training pipeline (trainer_combined.py) to reproduce or fine-tune the model on a chair dataset.
File Structure
• Top-level:
• assets/ — static resources and model checkpoints
• data_loaders/ — classes to load and augment datasets
• deep_sdf/ + models/ + pointnetpp/ — neural-network architectures and utilities
• ui_sketch/ — UI entrypoint, controllers, and mesh/render utilities
• utils/ — shared helper modules (I/O, meshing, evaluation, rotation, SVG, etc.)
• run.py — simple CLI inference script
• trainer_combined.py — end-to-end training orchestration
• constants.py, custom_types.py, options.py — global config and type definitions
README for Insights
• The system uses two pre‐trained decoders:
• Supports both batch/CLI mode and interactive real-time mode with PyQt/OpenGL.
Main Components and Their Relationships
a. Data Layer
• assets/data/ (preprocessed meshes, sketches)
• data_loaders/ modules feed data into networks
b. Model Layer
• deep_sdf/, models/, pointnetpp/ define encoder/decoder networks and loss functions
• options.py/config constants select architectures at runtime
c. Training Pipeline
• trainer_combined.py orchestrates data loading, model instantiation, optimizer setup (utils/train_utils.py), logging, and checkpoint saving to assets/checkpoints/
d. Inference Pipelines
• CLI (run.py): loads checkpoints, loads a single sketch, runs forward pass, and writes mesh .obj to assets/output/
• GUI (ui_sketch/sketch_main.py + controllers): real-time sketch canvas → inference_processing → occ_inference & sketch_inference → mesh_plotter → on-screen rendering; user can select parts and re-infer subregions.
e. Utilities
• utils/*: meshing (mcubes_meshing), mesh export (mesh_utils), evaluation, image/svg I/O, rotation transforms
Architectural Patterns & Design Principles
• Modular separation: data loading, model definitions, training, inference, and UI are in distinct packages
• Config-driven instantiation: options.py and environment.yml drive reproducibility
• Single responsibility: each module/class has a focused purpose (e.g., clipasso_dataset.py vs. prosketch_dataset.py)