# nabilkdarwish/ai-virtual-fitting-room architecture

> Architecture diagram of the GitHub repository nabilkdarwish/ai-virtual-fitting-room, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nabilkdarwish/ai-virtual-fitting-room
- Repository: https://github.com/nabilkdarwish/ai-virtual-fitting-room

## Overview

This repository is an AI virtual fitting-room project. The README describes a camera-to-try-on workflow, while the sampled Streamlit interface currently supports still-image capture or upload, catalog browsing, and selection confirmation; it explicitly says try-on generation is not yet connected. The graph preserves the documented processing stages, but treats their interconnections as documented intended flow rather than verified runtime calls. Source excerpts for the backend and processing modules are empty, so their internal wiring cannot be confirmed.

Main entry points: [`05_Frontend_Backend/frontend/app.py`](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/05_Frontend_Backend/frontend/app.py) (Streamlit interface), [`04_Virtual_TryOn/tryon_engine.py`](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/04_Virtual_TryOn/tryon_engine.py) (Try-on engine), [`01_Computer_Vision/frame_processor.py`](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/01_Computer_Vision/frame_processor.py) (Frame processing), [`03_AI_Models/model_inference.py`](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/03_AI_Models/model_inference.py) (Model inference)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vision["Computer vision"]
  node_vision_capture["Capture and tracking<br/>[camera_manager.py]"]
  node_vision_pose["Pose estimation<br/>[pose_estimation.py]"]
  node_vision_detection["Human detection<br/>[human_detection.py]"]
  node_vision_smoothing["Pose smoothing<br/>[pose_smoothing.py]"]
  node_vision_frame["Frame processing<br/>[frame_processor.py]"]
end

subgraph group_processing["Image processing"]
  node_image_preprocess["Preprocessing<br/>[preprocessing.py]"]
  node_image_segment["Human segmentation"]
  node_image_clothing["Clothing segmentation"]
  node_image_parse["Body parsing<br/>[body_parsing.py]"]
  node_image_masks["Mask generation<br/>[mask_generation.py]"]
  node_image_enhance["Image enhancement"]
end

subgraph group_models["AI models"]
  node_model_manager["Model management<br/>[model_manager.py]"]
  node_model_inference["Model inference<br/>[model_inference.py]"]
  node_model_eval["Model evaluation"]
end

subgraph group_tryon["Virtual try-on"]
  node_tryon_engine["Try-on engine<br/>[tryon_engine.py]"]
  node_garment_loader["Garment loading<br/>[garment_loader.py]"]
  node_garment_alignment["Garment alignment"]
  node_garment_warping["Garment warping<br/>[garment_warping.py]"]
  node_compositor["Image compositing<br/>[compositor.py]"]
  node_rendering["Result rendering<br/>[rendering.py]"]
end

subgraph group_interface["User interface"]
  node_frontend["Streamlit interface<br/>[app.py]"]
  node_api["API routes<br/>[api_routes.py]"]
  node_voice["Voice control"]
  node_display["Display control"]
  node_session["Session management<br/>[session_manager.py]"]
end

node_user(("User"))
node_camera(("Laptop camera"))
node_microphone(("Microphone"))

node_camera -->|"captures video"| node_vision_capture
node_user -->|"selects garment"| node_frontend
node_frontend -->|"voice selection"| node_voice
node_microphone -->|"provides audio"| node_voice
node_vision_capture -->|"provides frames"| node_vision_frame
node_vision_frame -->|"extracts pose"| node_vision_pose
node_vision_pose -->|"smooths motion"| node_vision_smoothing
node_vision_frame -->|"detects person"| node_vision_detection
node_vision_frame -->|"passes frame"| node_image_preprocess
node_image_preprocess -->|"segments person"| node_image_segment
node_image_segment -->|"parses body"| node_image_parse
node_image_parse -->|"isolates clothing"| node_image_clothing
node_image_clothing -->|"generates mask"| node_image_masks
node_image_masks -->|"supplies mask"| node_tryon_engine
node_image_enhance -.->|"enhances input"| node_tryon_engine
node_tryon_engine -.->|"loads garment"| node_garment_loader
node_tryon_engine -->|"aligns garment"| node_garment_alignment
node_garment_alignment -->|"warps garment"| node_garment_warping
node_tryon_engine -->|"uses model"| node_model_manager
node_model_manager -.->|"runs inference"| node_model_inference
node_model_inference -->|"provides synthesis"| node_compositor
node_garment_warping -->|"provides warped garment"| node_compositor
node_compositor -->|"renders result"| node_rendering
node_rendering -->|"displays result"| node_frontend
node_model_inference -.->|"evaluates output"| node_model_eval
node_frontend -.->|"presents preview"| node_display
node_frontend -.->|"stores selection"| node_session
node_frontend -.->|"requests processing"| node_api

click node_vision_capture "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/01_Computer_Vision/camera_manager.py"
click node_vision_pose "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/01_Computer_Vision/pose_estimation.py"
click node_vision_detection "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/01_Computer_Vision/human_detection.py"
click node_vision_smoothing "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/01_Computer_Vision/pose_smoothing.py"
click node_vision_frame "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/01_Computer_Vision/frame_processor.py"
click node_image_preprocess "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/02_Image_Processing/preprocessing.py"
click node_image_segment "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/02_Image_Processing/human_segmentation.py"
click node_image_clothing "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/02_Image_Processing/clothing_segmentation.py"
click node_image_parse "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/02_Image_Processing/body_parsing.py"
click node_image_masks "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/02_Image_Processing/mask_generation.py"
click node_image_enhance "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/02_Image_Processing/image_enhancement.py"
click node_model_manager "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/03_AI_Models/model_manager.py"
click node_model_inference "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/03_AI_Models/model_inference.py"
click node_model_eval "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/03_AI_Models/model_evaluation.py"
click node_tryon_engine "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/04_Virtual_TryOn/tryon_engine.py"
click node_garment_loader "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/04_Virtual_TryOn/garment_loader.py"
click node_garment_alignment "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/04_Virtual_TryOn/garment_alignment.py"
click node_garment_warping "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/04_Virtual_TryOn/garment_warping.py"
click node_compositor "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/04_Virtual_TryOn/compositor.py"
click node_rendering "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/04_Virtual_TryOn/rendering.py"
click node_frontend "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/05_Frontend_Backend/frontend/app.py"
click node_api "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/05_Frontend_Backend/backend/api_routes.py"
click node_voice "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/05_Frontend_Backend/backend/voice_controller.py"
click node_display "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/05_Frontend_Backend/backend/display_controller.py"
click node_session "https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/05_Frontend_Backend/backend/session_manager.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_vision_capture,node_vision_pose,node_vision_detection,node_vision_smoothing,node_vision_frame,node_user toneBlue
class node_image_preprocess,node_image_segment,node_image_clothing,node_image_parse,node_image_masks,node_image_enhance toneAmber
class node_model_manager,node_model_inference,node_model_eval toneMint
class node_tryon_engine,node_garment_loader,node_garment_alignment,node_garment_warping,node_compositor,node_rendering toneRose
class node_frontend,node_api,node_voice,node_display,node_session,node_camera,node_microphone toneIndigo
```

## Components

### Computer vision

- [Capture and tracking](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/01_Computer_Vision/camera_manager.py): `01_Computer_Vision/camera_manager.py`
- [Pose estimation](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/01_Computer_Vision/pose_estimation.py): `01_Computer_Vision/pose_estimation.py`
- [Human detection](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/01_Computer_Vision/human_detection.py): `01_Computer_Vision/human_detection.py`
- [Pose smoothing](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/01_Computer_Vision/pose_smoothing.py): `01_Computer_Vision/pose_smoothing.py`
- [Frame processing](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/01_Computer_Vision/frame_processor.py): `01_Computer_Vision/frame_processor.py`

### Image processing

- [Preprocessing](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/02_Image_Processing/preprocessing.py): `02_Image_Processing/preprocessing.py`
- [Human segmentation](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/02_Image_Processing/human_segmentation.py): `02_Image_Processing/human_segmentation.py`
- [Clothing segmentation](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/02_Image_Processing/clothing_segmentation.py): `02_Image_Processing/clothing_segmentation.py`
- [Body parsing](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/02_Image_Processing/body_parsing.py): `02_Image_Processing/body_parsing.py`
- [Mask generation](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/02_Image_Processing/mask_generation.py): `02_Image_Processing/mask_generation.py`
- [Image enhancement](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/02_Image_Processing/image_enhancement.py): `02_Image_Processing/image_enhancement.py`

### AI models

- [Model management](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/03_AI_Models/model_manager.py): `03_AI_Models/model_manager.py`
- [Model inference](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/03_AI_Models/model_inference.py): `03_AI_Models/model_inference.py`
- [Model evaluation](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/03_AI_Models/model_evaluation.py): `03_AI_Models/model_evaluation.py`

### Virtual try-on

- [Try-on engine](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/04_Virtual_TryOn/tryon_engine.py): `04_Virtual_TryOn/tryon_engine.py`
- [Garment loading](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/04_Virtual_TryOn/garment_loader.py): `04_Virtual_TryOn/garment_loader.py`
- [Garment alignment](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/04_Virtual_TryOn/garment_alignment.py): `04_Virtual_TryOn/garment_alignment.py`
- [Garment warping](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/04_Virtual_TryOn/garment_warping.py): `04_Virtual_TryOn/garment_warping.py`
- [Image compositing](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/04_Virtual_TryOn/compositor.py): `04_Virtual_TryOn/compositor.py`
- [Result rendering](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/04_Virtual_TryOn/rendering.py): `04_Virtual_TryOn/rendering.py`

### User interface

- [Streamlit interface](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/05_Frontend_Backend/frontend/app.py): `05_Frontend_Backend/frontend/app.py`
- [API routes](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/05_Frontend_Backend/backend/api_routes.py): `05_Frontend_Backend/backend/api_routes.py`
- [Voice control](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/05_Frontend_Backend/backend/voice_controller.py): `05_Frontend_Backend/backend/voice_controller.py`
- [Display control](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/05_Frontend_Backend/backend/display_controller.py): `05_Frontend_Backend/backend/display_controller.py`
- [Session management](https://github.com/nabilkdarwish/ai-virtual-fitting-room/blob/main/05_Frontend_Backend/backend/session_manager.py): `05_Frontend_Backend/backend/session_manager.py`

### Other components

- **User**
- **Laptop camera**
- **Microphone**

## Connections

- Laptop camera → Capture and tracking: captures video (evidence: `README.md`)
- User → Streamlit interface: selects garment (evidence: `README.md`)
- Streamlit interface → Voice control: voice selection (evidence: `README.md`)
- Microphone → Voice control: provides audio (evidence: `README.md`)
- Capture and tracking → Frame processing: provides frames (evidence: `README.md`)
- Frame processing → Pose estimation: extracts pose (evidence: `README.md`)
- Pose estimation → Pose smoothing: smooths motion (evidence: `README.md`)
- Frame processing → Human detection: detects person (evidence: `README.md`)
- Frame processing → Preprocessing: passes frame (evidence: `README.md`)
- Preprocessing → Human segmentation: segments person (evidence: `README.md`)
- Human segmentation → Body parsing: parses body (evidence: `README.md`)
- Body parsing → Clothing segmentation: isolates clothing (evidence: `README.md`)
- Clothing segmentation → Mask generation: generates mask (evidence: `README.md`)
- Mask generation → Try-on engine: supplies mask (evidence: `README.md`)
- Image enhancement → Try-on engine: enhances input
- Try-on engine → Garment loading: loads garment
- Try-on engine → Garment alignment: aligns garment (evidence: `README.md`)
- Garment alignment → Garment warping: warps garment (evidence: `README.md`)
- Try-on engine → Model management: uses model (evidence: `README.md`)
- Model management → Model inference: runs inference
- Model inference → Image compositing: provides synthesis (evidence: `README.md`)
- Garment warping → Image compositing: provides warped garment (evidence: `README.md`)
- Image compositing → Result rendering: renders result (evidence: `README.md`)
- Result rendering → Streamlit interface: displays result (evidence: `README.md`)
- Model inference → Model evaluation: evaluates output
- Streamlit interface → Display control: presents preview
- Streamlit interface → Session management: stores selection
- Streamlit interface → API routes: requests processing
