How milanbpatel90-a11y/deformation works
This repository is an eyewear virtual-try-on and 3D asset-generation toolkit. Its main image workflow segments glasses, classifies their style, extracts physical measurements, selects a template, deforms its mesh, and exports a GLB. It also contains an automatic parametric-generation path, a separate glasses3d CLI workflow, API/authentication and rim-detection routes, template matching and measurement-fusion modules, and Blender/factory tooling for preparing assets. The graph emphasizes relationships visible in excerpts or the source index; unsampled subsystems and API dispatch details are not asserted as verified calls.
Main entry points: pipeline.py Deformation workflow · auto_3d_pipeline.py Auto 3D workflow · glasses3d/main.py Glasses3D CLI · api/main.py API service
Components 24
API and access
- API service
backend/api/main.py - Authentication
backend/auth.py - Rim detection API
backend/api/rim_detection_routes.py
Image understanding
- Glasses segmentation
backend/segmentation/segmenter.py - Style classification
backend/classifier/shape_classifier.py - Image measurements
backend/measurement/extractor.py - Mask measurements
backend/measurement/mask_to_measurements.py - Measurement fusion
backend/fusion/measurement_fuser.py - View classification
backend/fusion/view_classifier.py - Lens opacity
backend/fusion/opacity_detector.py
3D generation
- Deformation workflow
backend/pipeline.py - Auto 3D workflow
backend/pipeline/auto_3d_pipeline.py - Deformation context
backend/deformer/deformation_context.py - Mesh deformation
backend/deformer/engine.py - Parametric generator
backend/generator/parametric_glb_generator.py - GLB export
backend/exporter/glb_exporter.py - PBR materials
backend/materials/pbr.py - Glasses3D CLI
glasses3d/main.py
Template assets
- Template library
backend/template_library/loader.py - Template matching
backend/template_matching/scoring.py - Template descriptors
backend/deformer/descriptor_loader.py
Asset authoring
- Blender authoring
designer/blender_addon/geometry.py - Asset factory
factory/importer.py
Other components
- Image user
Connections 26
- Image user → API service: submits images
- API service → Authentication: uses access control
backend/api/main.py - API service → Deformation workflow: dispatches workflow
backend/api/main.py - API service → Rim detection API: routes requests
backend/api/main.py - Deformation workflow → Glasses segmentation: segments image
backend/pipeline.py - Deformation workflow → Style classification: classifies style
backend/pipeline.py - Deformation workflow → Image measurements: extracts measurements
backend/pipeline.py - Deformation workflow → Template library: loads template
backend/pipeline.py - Deformation workflow → Mesh deformation: deforms mesh
backend/pipeline.py - Deformation workflow → PBR materials: applies materials
backend/pipeline.py - Deformation workflow → GLB export: exports model
backend/pipeline.py - Auto 3D workflow → Glasses segmentation: segments image
backend/pipeline/auto_3d_pipeline.py - Auto 3D workflow → Style classification: classifies shape
backend/pipeline/auto_3d_pipeline.py - Auto 3D workflow → Mask measurements: extracts dimensions
backend/pipeline/auto_3d_pipeline.py - Auto 3D workflow → Parametric generator: generates model
backend/pipeline/auto_3d_pipeline.py - Mesh deformation → Deformation context: updates context
backend/deformer/engine.py - Deformation context → Template descriptors: loads descriptor
backend/deformer/deformation_context.py - Mesh deformation → Template library: uses template
- Deformation workflow → Measurement fusion: fuses measurements
- Deformation workflow → View classification: classifies views
- Deformation workflow → Lens opacity: detects opacity
- Template library → Template matching: supports retrieval
- Glasses3D CLI → Glasses segmentation: preprocesses images
- Glasses3D CLI → Template library: loads template
glasses3d/main.py - Glasses3D CLI → Mesh deformation: deforms template
glasses3d/main.py - Glasses3D CLI → GLB export: exports GLB
glasses3d/main.py