# dharmshah/imageto3dconverter architecture

> Architecture diagram of the GitHub repository dharmshah/imageto3dconverter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dharmshah/imageto3dconverter
- Repository: https://github.com/dharmshah/imageto3dconverter

## Overview

MYFASHION turns garment photos into processed, reconstructed GLB assets, with a React studio for managing and viewing garments, virtual try-on, and a separate segmentation workflow. The documented reconstruction path runs from four-view intake through geometry, mesh refinement, texture baking, and GLB export; the backend also exposes local CPU segmentation. Sampled source supports the app entry points and several orchestration links; other subsystem relationships below are included only where documented or indexed.

Main entry points: [`backend/app/services/reconstruction_engine/pipeline.py`](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/pipeline.py) (Reconstruction pipeline), [`backend/app/routes/garments.py`](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/routes/garments.py) (Garment routes), [`frontend/src/App.tsx`](https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/App.tsx) (Studio workspace), [`frontend/src/components/VirtualTryOn/VirtualTryOnView.tsx`](https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/components/VirtualTryOn/VirtualTryOnView.tsx) (Virtual try-on)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_studio["Web Studio"]
  node_webapp["Studio workspace<br/>[App.tsx]"]
  node_stock["Garment stock"]
  node_tryon["Virtual try-on"]
  node_pose["Pose fitting"]
  node_deform["Garment deformation"]
  node_manifest["Model manifest"]
  node_segpanel["Segmentation panel"]
end

subgraph group_garments["Garment Workflow"]
  node_garmentapi["Garment API client<br/>[garmentApi.ts]"]
  node_api["FastAPI application<br/>[main.py]"]
  node_garmentroutes["Garment routes<br/>[garments.py]"]
  node_upload["Garment uploads"]
  node_preprocess["Image preprocessing"]
  node_reconstructionservice["Reconstruction jobs"]
  node_artifactservices["Mesh and GLB services"]
end

subgraph group_reconstruction["3D Reconstruction"]
  node_pipeline["Reconstruction pipeline<br/>[pipeline.py]"]
  node_alignment["View alignment<br/>[alignment.py]"]
  node_geometry["Geometry fusion<br/>[geometry.py]"]
  node_refinement["Mesh refinement<br/>[mesh_refinement.py]"]
  node_texture["Texture projection"]
  node_blending["Texture blending"]
  node_export["GLB export<br/>[glb_exporter.py]"]
end

subgraph group_segmentation["AI Segmentation"]
  node_segapi["Segmentation API client<br/>[segmentationApi.ts]"]
  node_segroutes["Segmentation routes<br/>[segmentation.py]"]
  node_segservice["Segmentation inference"]
end

node_user(("Studio user"))

node_user -->|"uses"| node_webapp
node_webapp -->|"requests"| node_garmentapi
node_webapp -->|"renders"| node_stock
node_webapp -->|"renders"| node_tryon
node_stock -->|"requests"| node_garmentapi
node_garmentapi -.->|"calls"| node_garmentroutes
node_api -->|"registers"| node_garmentroutes
node_api -->|"registers"| node_segroutes
node_garmentroutes -->|"delegates"| node_upload
node_garmentroutes -->|"delegates"| node_preprocess
node_garmentroutes -->|"submits jobs"| node_reconstructionservice
node_garmentroutes -->|"delegates"| node_artifactservices
node_reconstructionservice -->|"runs"| node_pipeline
node_pipeline -->|"uses"| node_alignment
node_pipeline -->|"uses"| node_geometry
node_pipeline -->|"uses"| node_refinement
node_pipeline -->|"projects"| node_texture
node_pipeline -->|"blends"| node_blending
node_pipeline -->|"exports"| node_export
node_tryon -.->|"fits pose"| node_pose
node_tryon -.->|"deforms garment"| node_deform
node_deform -->|"uses config"| node_manifest
node_pose -->|"uses config"| node_manifest
node_user -->|"tests images"| node_segpanel
node_segpanel -.->|"requests"| node_segapi
node_segapi -.->|"calls"| node_segroutes
node_segroutes -.->|"invokes"| node_segservice

click node_webapp "https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/App.tsx"
click node_stock "https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/components/GarmentStockPanel.tsx"
click node_tryon "https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/components/VirtualTryOn/VirtualTryOnView.tsx"
click node_pose "https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/services/poseFittingEngine.ts"
click node_deform "https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/services/garmentDeformationEngine.ts"
click node_manifest "https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/services/garmentModelsManifest.ts"
click node_garmentapi "https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/services/garmentApi.ts"
click node_api "https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/main.py"
click node_garmentroutes "https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/routes/garments.py"
click node_upload "https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/garment_upload_service.py"
click node_preprocess "https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/image_preprocessing_service.py"
click node_reconstructionservice "https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/local_reconstruction_service.py"
click node_artifactservices "https://github.com/dharmshah/imageto3dconverter/tree/main/backend/app/services"
click node_pipeline "https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/pipeline.py"
click node_alignment "https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/alignment.py"
click node_geometry "https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/geometry.py"
click node_refinement "https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/mesh_refinement.py"
click node_texture "https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/texture_projection.py"
click node_blending "https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/texture_blending.py"
click node_export "https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/glb_exporter.py"
click node_segpanel "https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/components/SegmentationTestPanel.tsx"
click node_segapi "https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/services/segmentationApi.ts"
click node_segroutes "https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/routes/segmentation.py"
click node_segservice "https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/segmentation_service.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_stock,node_tryon,node_pose,node_deform,node_manifest,node_segpanel,node_user toneBlue
class node_garmentapi,node_api,node_garmentroutes,node_upload,node_preprocess,node_reconstructionservice,node_artifactservices toneAmber
class node_pipeline,node_alignment,node_geometry,node_refinement,node_texture,node_blending,node_export toneMint
class node_segapi,node_segroutes,node_segservice toneRose
```

## Components

### Web Studio

- [Studio workspace](https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Garment stock](https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/components/GarmentStockPanel.tsx): `frontend/src/components/GarmentStockPanel.tsx`
- [Virtual try-on](https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/components/VirtualTryOn/VirtualTryOnView.tsx): `frontend/src/components/VirtualTryOn/VirtualTryOnView.tsx`
- [Pose fitting](https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/services/poseFittingEngine.ts): `frontend/src/services/poseFittingEngine.ts`
- [Garment deformation](https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/services/garmentDeformationEngine.ts): `frontend/src/services/garmentDeformationEngine.ts`
- [Model manifest](https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/services/garmentModelsManifest.ts): `frontend/src/services/garmentModelsManifest.ts`
- [Segmentation panel](https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/components/SegmentationTestPanel.tsx): `frontend/src/components/SegmentationTestPanel.tsx`

### Garment Workflow

- [Garment API client](https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/services/garmentApi.ts): `frontend/src/services/garmentApi.ts`
- [FastAPI application](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/main.py): `backend/app/main.py`
- [Garment routes](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/routes/garments.py): `backend/app/routes/garments.py`
- [Garment uploads](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/garment_upload_service.py): `backend/app/services/garment_upload_service.py`
- [Image preprocessing](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/image_preprocessing_service.py): `backend/app/services/image_preprocessing_service.py`
- [Reconstruction jobs](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/local_reconstruction_service.py): `backend/app/services/local_reconstruction_service.py`
- [Mesh and GLB services](https://github.com/dharmshah/imageto3dconverter/tree/main/backend/app/services): `backend/app/services`

### 3D Reconstruction

- [Reconstruction pipeline](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/pipeline.py): `backend/app/services/reconstruction_engine/pipeline.py`
- [View alignment](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/alignment.py): `backend/app/services/reconstruction_engine/alignment.py`
- [Geometry fusion](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/geometry.py): `backend/app/services/reconstruction_engine/geometry.py`
- [Mesh refinement](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/mesh_refinement.py): `backend/app/services/reconstruction_engine/mesh_refinement.py`
- [Texture projection](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/texture_projection.py): `backend/app/services/reconstruction_engine/texture_projection.py`
- [Texture blending](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/texture_blending.py): `backend/app/services/reconstruction_engine/texture_blending.py`
- [GLB export](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/reconstruction_engine/glb_exporter.py): `backend/app/services/reconstruction_engine/glb_exporter.py`

### AI Segmentation

- [Segmentation API client](https://github.com/dharmshah/imageto3dconverter/blob/main/frontend/src/services/segmentationApi.ts): `frontend/src/services/segmentationApi.ts`
- [Segmentation routes](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/routes/segmentation.py): `backend/app/routes/segmentation.py`
- [Segmentation inference](https://github.com/dharmshah/imageto3dconverter/blob/main/backend/app/services/segmentation_service.py): `backend/app/services/segmentation_service.py`

### Other components

- **Studio user**

## Connections

- Studio user → Studio workspace: uses
- Studio workspace → Garment API client: requests (evidence: `frontend/src/App.tsx`)
- Studio workspace → Garment stock: renders (evidence: `frontend/src/App.tsx`)
- Studio workspace → Virtual try-on: renders (evidence: `frontend/src/App.tsx`)
- Garment stock → Garment API client: requests (evidence: `frontend/src/components/GarmentStockPanel.tsx`)
- Garment API client → Garment routes: calls
- FastAPI application → Garment routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Segmentation routes: registers (evidence: `backend/app/main.py`)
- Garment routes → Garment uploads: delegates (evidence: `backend/app/routes/garments.py`)
- Garment routes → Image preprocessing: delegates (evidence: `backend/app/routes/garments.py`)
- Garment routes → Reconstruction jobs: submits jobs (evidence: `backend/app/routes/garments.py`)
- Garment routes → Mesh and GLB services: delegates (evidence: `backend/app/routes/garments.py`)
- Reconstruction jobs → Reconstruction pipeline: runs (evidence: `backend/app/services/local_reconstruction_service.py`)
- Reconstruction pipeline → View alignment: uses (evidence: `backend/app/services/reconstruction_engine/pipeline.py`)
- Reconstruction pipeline → Geometry fusion: uses (evidence: `backend/app/services/reconstruction_engine/pipeline.py`)
- Reconstruction pipeline → Mesh refinement: uses (evidence: `backend/app/services/reconstruction_engine/pipeline.py`)
- Reconstruction pipeline → Texture projection: projects (evidence: `backend/app/services/reconstruction_engine/pipeline.py`)
- Reconstruction pipeline → Texture blending: blends (evidence: `backend/app/services/reconstruction_engine/pipeline.py`)
- Reconstruction pipeline → GLB export: exports (evidence: `backend/app/services/reconstruction_engine/pipeline.py`)
- Virtual try-on → Pose fitting: fits pose
- Virtual try-on → Garment deformation: deforms garment
- Garment deformation → Model manifest: uses config (evidence: `frontend/src/services/garmentDeformationEngine.ts`)
- Pose fitting → Model manifest: uses config (evidence: `frontend/src/services/poseFittingEngine.ts`)
- Studio user → Segmentation panel: tests images
- Segmentation panel → Segmentation API client: requests
- Segmentation API client → Segmentation routes: calls
- Segmentation routes → Segmentation inference: invokes
