# kisekloset/dm-vton architecture

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

- Interactive diagram: https://gitdiagram.com/kisekloset/dm-vton
- Repository: https://github.com/kisekloset/dm-vton

## Overview

DM-VTON is a virtual try-on research and inference system centered on a lightweight warp-then-generate pipeline. Its primary workflow takes a person, garment, and garment edge, aligns the garment, then composites a rendered try-on result. The README also describes teacher/student training in separate warping-only and end-to-end stages, plus inference evaluation. The repository includes a wider model zoo and video inference path; their internal implementations are only partly sampled, so those links are limited to documented or indexed relationships.

Main entry points: [`exp/runtime/main.py`](https://github.com/kisekloset/dm-vton/blob/main/exp/runtime/main.py) (Runtime model runner), [`pipelines/dmvton_pipeline.py`](https://github.com/kisekloset/dm-vton/blob/main/pipelines/dmvton_pipeline.py) (DM-VTON pipeline), [`models/warp_modules/mobile_afwm.py`](https://github.com/kisekloset/dm-vton/blob/main/models/warp_modules/mobile_afwm.py) (Mobile warper), [`train_pf_warp.py`](https://github.com/kisekloset/dm-vton/blob/main/train_pf_warp.py) (Warp-only stage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tryon["Try-on pipeline"]
  node_inputs["Person and garment<br/>[viton_dataset.py]"]
  node_pipeline["DM-VTON pipeline<br/>[dmvton_pipeline.py]"]
  node_warper["Mobile warper<br/>[mobile_afwm.py]"]
  node_features["Mobile feature pyramid<br/>[mobile_fpn.py]"]
  node_correlation["Feature correlation<br/>[correlation.py]"]
  node_generator["Try-on generator<br/>[mobile_unet.py]"]
  node_base_model["Model base<br/>[base_model.py]"]
  node_result["Try-on image"]
end

subgraph group_training["Training"]
  node_train_data["VITON data<br/>[viton_dataset.py]"]
  node_train_options["Training options<br/>[train_opt.py]"]
  node_warp_stage["Warp-only stage<br/>[train_pf_warp.py]"]
  node_e2e_stage["End-to-end stage<br/>[train_pf_e2e.py]"]
  node_teacher["FS-VTON teacher<br/>[afwm.py]"]
end

subgraph group_inference["Inference variants"]
  node_runtime["Runtime model runner<br/>[main.py]"]
  node_video_runner["Video inference<br/>[main.py]"]
  node_pose["Pose estimation<br/>[estimator.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_metrics["Image metrics<br/>[fid_score.py]"]
  node_lpips["Perceptual metric<br/>[lpips.py]"]
  node_profile["Runtime profiling<br/>[general.py]"]
end

node_user(("Try-on user"))
node_train_user(("Model trainer"))

node_user -.->|"provides pair"| node_inputs
node_inputs -.->|"supplies inputs"| node_pipeline
node_pipeline -->|"warps garment"| node_warper
node_warper -->|"extracts features"| node_features
node_warper -->|"computes correlation"| node_correlation
node_pipeline -->|"generates composite"| node_generator
node_pipeline -->|"returns image"| node_result
node_generator -->|"inherits"| node_base_model
node_train_user -.->|"prepares data"| node_train_data
node_train_user -.->|"starts training"| node_warp_stage
node_train_user -.->|"starts training"| node_e2e_stage
node_train_options -->|"configures"| node_warp_stage
node_train_options -->|"configures"| node_e2e_stage
node_teacher -.->|"guides student"| node_warp_stage
node_teacher -.->|"guides student"| node_e2e_stage
node_runtime -.->|"runs model"| node_pipeline
node_video_runner -->|"requests keypoints"| node_pose
node_video_runner -.->|"selects model"| node_runtime
node_runtime -.->|"evaluates results"| node_metrics
node_runtime -.->|"evaluates results"| node_lpips
node_runtime -.->|"measures runtime"| node_profile

click node_inputs "https://github.com/kisekloset/dm-vton/blob/main/dataloader/viton_dataset.py"
click node_pipeline "https://github.com/kisekloset/dm-vton/blob/main/pipelines/dmvton_pipeline.py"
click node_warper "https://github.com/kisekloset/dm-vton/blob/main/models/warp_modules/mobile_afwm.py"
click node_features "https://github.com/kisekloset/dm-vton/blob/main/models/extractors/mobile_fpn.py"
click node_correlation "https://github.com/kisekloset/dm-vton/blob/main/models/common/correlation.py"
click node_generator "https://github.com/kisekloset/dm-vton/blob/main/models/generators/mobile_unet.py"
click node_base_model "https://github.com/kisekloset/dm-vton/blob/main/models/base_model.py"
click node_train_data "https://github.com/kisekloset/dm-vton/blob/main/dataloader/viton_dataset.py"
click node_train_options "https://github.com/kisekloset/dm-vton/blob/main/opt/train_opt.py"
click node_warp_stage "https://github.com/kisekloset/dm-vton/blob/main/train_pf_warp.py"
click node_e2e_stage "https://github.com/kisekloset/dm-vton/blob/main/train_pf_e2e.py"
click node_teacher "https://github.com/kisekloset/dm-vton/blob/main/exp/metric/FS_VTON/models/afwm.py"
click node_runtime "https://github.com/kisekloset/dm-vton/blob/main/exp/runtime/main.py"
click node_video_runner "https://github.com/kisekloset/dm-vton/blob/main/exp/video_inference/main.py"
click node_pose "https://github.com/kisekloset/dm-vton/blob/main/exp/video_inference/yolov7_pose/estimator.py"
click node_metrics "https://github.com/kisekloset/dm-vton/blob/main/utils/metrics/pytorch_fid/fid_score.py"
click node_lpips "https://github.com/kisekloset/dm-vton/blob/main/utils/metrics/lpips/lpips.py"
click node_profile "https://github.com/kisekloset/dm-vton/blob/main/utils/general.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_inputs,node_pipeline,node_warper,node_features,node_correlation,node_generator,node_base_model,node_result,node_user toneBlue
class node_train_data,node_train_options,node_warp_stage,node_e2e_stage,node_teacher toneAmber
class node_runtime,node_video_runner,node_pose toneMint
class node_metrics,node_lpips,node_profile toneRose
class node_train_user toneIndigo
```

## Components

### Try-on pipeline

- [Person and garment](https://github.com/kisekloset/dm-vton/blob/main/dataloader/viton_dataset.py): `dataloader/viton_dataset.py`
- [DM-VTON pipeline](https://github.com/kisekloset/dm-vton/blob/main/pipelines/dmvton_pipeline.py): `pipelines/dmvton_pipeline.py`
- [Mobile warper](https://github.com/kisekloset/dm-vton/blob/main/models/warp_modules/mobile_afwm.py): `models/warp_modules/mobile_afwm.py`
- [Mobile feature pyramid](https://github.com/kisekloset/dm-vton/blob/main/models/extractors/mobile_fpn.py): `models/extractors/mobile_fpn.py`
- [Feature correlation](https://github.com/kisekloset/dm-vton/blob/main/models/common/correlation.py): `models/common/correlation.py`
- [Try-on generator](https://github.com/kisekloset/dm-vton/blob/main/models/generators/mobile_unet.py): `models/generators/mobile_unet.py`
- [Model base](https://github.com/kisekloset/dm-vton/blob/main/models/base_model.py): `models/base_model.py`
- **Try-on image**

### Training

- [VITON data](https://github.com/kisekloset/dm-vton/blob/main/dataloader/viton_dataset.py): `dataloader/viton_dataset.py`
- [Training options](https://github.com/kisekloset/dm-vton/blob/main/opt/train_opt.py): `opt/train_opt.py`
- [Warp-only stage](https://github.com/kisekloset/dm-vton/blob/main/train_pf_warp.py): `train_pf_warp.py`
- [End-to-end stage](https://github.com/kisekloset/dm-vton/blob/main/train_pf_e2e.py): `train_pf_e2e.py`
- [FS-VTON teacher](https://github.com/kisekloset/dm-vton/blob/main/exp/metric/FS_VTON/models/afwm.py): `exp/metric/FS_VTON/models/afwm.py`

### Inference variants

- [Runtime model runner](https://github.com/kisekloset/dm-vton/blob/main/exp/runtime/main.py): `exp/runtime/main.py`
- [Video inference](https://github.com/kisekloset/dm-vton/blob/main/exp/video_inference/main.py): `exp/video_inference/main.py`
- [Pose estimation](https://github.com/kisekloset/dm-vton/blob/main/exp/video_inference/yolov7_pose/estimator.py): `exp/video_inference/yolov7_pose/estimator.py`

### Evaluation

- [Image metrics](https://github.com/kisekloset/dm-vton/blob/main/utils/metrics/pytorch_fid/fid_score.py): `utils/metrics/pytorch_fid/fid_score.py`
- [Perceptual metric](https://github.com/kisekloset/dm-vton/blob/main/utils/metrics/lpips/lpips.py): `utils/metrics/lpips/lpips.py`
- [Runtime profiling](https://github.com/kisekloset/dm-vton/blob/main/utils/general.py): `utils/general.py`

### Other components

- **Try-on user**
- **Model trainer**

## Connections

- Try-on user → Person and garment: provides pair (evidence: `README.md`)
- Person and garment → DM-VTON pipeline: supplies inputs (evidence: `README.md`)
- DM-VTON pipeline → Mobile warper: warps garment (evidence: `pipelines/dmvton_pipeline.py`)
- Mobile warper → Mobile feature pyramid: extracts features (evidence: `models/warp_modules/mobile_afwm.py`)
- Mobile warper → Feature correlation: computes correlation (evidence: `models/warp_modules/mobile_afwm.py`)
- DM-VTON pipeline → Try-on generator: generates composite (evidence: `pipelines/dmvton_pipeline.py`)
- DM-VTON pipeline → Try-on image: returns image (evidence: `pipelines/dmvton_pipeline.py`)
- Try-on generator → Model base: inherits (evidence: `models/generators/mobile_unet.py`)
- Model trainer → VITON data: prepares data (evidence: `README.md`)
- Model trainer → Warp-only stage: starts training (evidence: `README.md`)
- Model trainer → End-to-end stage: starts training (evidence: `README.md`)
- Training options → Warp-only stage: configures (evidence: `opt/train_opt.py`)
- Training options → End-to-end stage: configures (evidence: `opt/train_opt.py`)
- FS-VTON teacher → Warp-only stage: guides student (evidence: `README.md`)
- FS-VTON teacher → End-to-end stage: guides student (evidence: `README.md`)
- Runtime model runner → DM-VTON pipeline: runs model
- Video inference → Pose estimation: requests keypoints (evidence: `exp/video_inference/main.py`)
- Video inference → Runtime model runner: selects model
- Runtime model runner → Image metrics: evaluates results (evidence: `README.md`)
- Runtime model runner → Perceptual metric: evaluates results (evidence: `README.md`)
- Runtime model runner → Runtime profiling: measures runtime (evidence: `README.md`)
