How auto-d/shaperx works
Project type and purpose
• It bundles a PyTorch-based CNN pipeline (model training/inference) with a Gradio UI for interactive demos.
File structure
Top level
• app/
– app.py → Entrypoint for Gradio UI and inference pipeline
– cnn.py → Convolutional neural network definition and forward logic
– dataset.py → Dataset loading, preprocessing, and data-augmentation code
• data/ → Tab-delimited dataset manifests and associated 3D model artifacts (STLs)
• experimentation.ipynb → Notebook for exploratory model development and evaluation
• requirements.txt → Python dependencies (PyTorch, Gradio, Open3D, etc.)
• README.md → Project overview, run instructions, and known issues
README for additional insights
• The pipeline stages run sequentially: raw 3D models → histogram/non-DL baselines → CNN training → Gradio UI for demo.
• Deployment is local (Gradio on port 7860), with hard-coded paths to data/.
• Key external libs: PyTorch, Gradio, Open3D (for mesh loading).
Main components
a. Data Layer
• Raw 3D model files (.stl) and manifest files in data/
b. Preprocessing & Dataset Loader
• dataset.py: loads meshes via Open3D, applies scaling/lighting, sampling, converts to images/tensors
c. Model Training & Inference
• cnn.py: defines model architecture, loss, metrics
• experimentation.ipynb: dev/testing harness
d. Application Layer (Gradio UI)
• app.py: ties together data download, preprocessing, model inference, and UI widgets
e. Environment & Dependencies
• Python runtime, PyTorch, Gradio, Open3D
Relationships and interactions
• Data files → dataset.py → tensor batches
• Batches → cnn.py (training/inference) → prediction labels/confidence
• Predictions → app.py → displayed in Gradio frontend
• experimentation.ipynb sits off to the side: pulls from dataset.py & cnn.py for experiments
Architectural patterns & design principles
• Separation of concerns: data loading vs. model logic vs. UI
• Modular ML pipeline: interchangeable preprocessing or model components
• Single-process, single-repo deploy (no microservices)
Essential elements
• Clear component names and boundaries
• Arrowheads indicating data flow (preprocessed → model → predictions)
• Third-party dependencies next to each module (e.g., “PyTorch”, “Gradio”, “Open3D”)