# jychen9811/doc-vton architecture

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

- Interactive diagram: https://gitdiagram.com/jychen9811/doc-vton
- Repository: https://github.com/jychen9811/doc-vton

## Overview

DOC-VTON is a research virtual try-on system for generating a person image wearing a target garment, with OccluMix’s de-occlusion capability highlighted in the README. Its documented test workflow starts with `test_w_enhance.py`; the repository also contains aligned-data preparation, garment-warping and image-network components, plus image and mask utilities. Several runtime connections are not shown in the excerpts, so those links are left out or marked unverified rather than inferred from module names.

Main entry points: [`test_w_enhance.py`](https://github.com/jychen9811/doc-vton/blob/main/test_w_enhance.py) (Try-on test), [`models/afwm.py`](https://github.com/jychen9811/doc-vton/blob/main/models/afwm.py) (Garment warping), [`models/unet2.py`](https://github.com/jychen9811/doc-vton/blob/main/models/unet2.py) (U-Net models), [`data/aligned_dataset_train.py`](https://github.com/jychen9811/doc-vton/blob/main/data/aligned_dataset_train.py) (Aligned samples)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Try-on workflow"]
  node_test["Try-on test<br/>[test_w_enhance.py]"]
  node_options["Runtime options<br/>[base_options.py]"]
  node_result["Try-on image"]
end

subgraph group_data["Input data"]
  node_dataset["Aligned samples"]
  node_testdata["Test samples"]
  node_base_dataset["Image transforms<br/>[base_dataset.py]"]
  node_image_folder["Image collection<br/>[image_folder.py]"]
end

subgraph group_models["Vision models"]
  node_afwm["Garment warping<br/>[afwm.py]"]
  node_correlation["Feature correlation<br/>[correlation.py]"]
  node_unet["U-Net models<br/>[unet2.py]"]
  node_unet_parts["U-Net blocks<br/>[unet_parts.py]"]
  node_networks["Image networks<br/>[networks.py]"]
end

subgraph group_support["Image support"]
  node_eraser["Occlusion masks<br/>[util.py]"]
  node_image_output["Image conversion<br/>[util.py]"]
  node_pool["Image history pool<br/>[image_pool.py]"]
end

node_user(("Research user"))

node_user -->|"runs test"| node_test
node_dataset -->|"uses transforms"| node_base_dataset
node_unet -->|"uses blocks"| node_unet_parts
node_afwm -->|"uses correlation"| node_correlation
node_test -.->|"reads options"| node_options
node_test -.->|"loads samples"| node_testdata
node_test -.->|"warps garment"| node_afwm
node_test -.->|"runs segmentation"| node_unet
node_test -.->|"runs networks"| node_networks
node_test -.->|"uses occlusion masks"| node_eraser
node_test -.->|"converts output"| node_image_output
node_test -.->|"produces image"| node_result

click node_test "https://github.com/jychen9811/doc-vton/blob/main/test_w_enhance.py"
click node_options "https://github.com/jychen9811/doc-vton/blob/main/options/base_options.py"
click node_dataset "https://github.com/jychen9811/doc-vton/blob/main/data/aligned_dataset_train.py"
click node_testdata "https://github.com/jychen9811/doc-vton/blob/main/data/aligned_dataset_test.py"
click node_base_dataset "https://github.com/jychen9811/doc-vton/blob/main/data/base_dataset.py"
click node_image_folder "https://github.com/jychen9811/doc-vton/blob/main/data/image_folder.py"
click node_afwm "https://github.com/jychen9811/doc-vton/blob/main/models/afwm.py"
click node_correlation "https://github.com/jychen9811/doc-vton/blob/main/models/correlation/correlation.py"
click node_unet "https://github.com/jychen9811/doc-vton/blob/main/models/unet2.py"
click node_unet_parts "https://github.com/jychen9811/doc-vton/blob/main/models/unet_parts.py"
click node_networks "https://github.com/jychen9811/doc-vton/blob/main/models/networks.py"
click node_eraser "https://github.com/jychen9811/doc-vton/blob/main/util/util.py"
click node_image_output "https://github.com/jychen9811/doc-vton/blob/main/util/util.py"
click node_pool "https://github.com/jychen9811/doc-vton/blob/main/util/image_pool.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_test,node_options,node_result,node_user toneBlue
class node_dataset,node_testdata,node_base_dataset,node_image_folder toneAmber
class node_afwm,node_correlation,node_unet,node_unet_parts,node_networks toneMint
class node_eraser,node_image_output,node_pool toneRose
```

## Components

### Try-on workflow

- [Try-on test](https://github.com/jychen9811/doc-vton/blob/main/test_w_enhance.py): `test_w_enhance.py`
- [Runtime options](https://github.com/jychen9811/doc-vton/blob/main/options/base_options.py): `options/base_options.py`
- **Try-on image**

### Input data

- [Aligned samples](https://github.com/jychen9811/doc-vton/blob/main/data/aligned_dataset_train.py): `data/aligned_dataset_train.py`
- [Test samples](https://github.com/jychen9811/doc-vton/blob/main/data/aligned_dataset_test.py): `data/aligned_dataset_test.py`
- [Image transforms](https://github.com/jychen9811/doc-vton/blob/main/data/base_dataset.py): `data/base_dataset.py`
- [Image collection](https://github.com/jychen9811/doc-vton/blob/main/data/image_folder.py): `data/image_folder.py`

### Vision models

- [Garment warping](https://github.com/jychen9811/doc-vton/blob/main/models/afwm.py): `models/afwm.py`
- [Feature correlation](https://github.com/jychen9811/doc-vton/blob/main/models/correlation/correlation.py): `models/correlation/correlation.py`
- [U-Net models](https://github.com/jychen9811/doc-vton/blob/main/models/unet2.py): `models/unet2.py`
- [U-Net blocks](https://github.com/jychen9811/doc-vton/blob/main/models/unet_parts.py): `models/unet_parts.py`
- [Image networks](https://github.com/jychen9811/doc-vton/blob/main/models/networks.py): `models/networks.py`

### Image support

- [Occlusion masks](https://github.com/jychen9811/doc-vton/blob/main/util/util.py): `util/util.py`
- [Image conversion](https://github.com/jychen9811/doc-vton/blob/main/util/util.py): `util/util.py`
- [Image history pool](https://github.com/jychen9811/doc-vton/blob/main/util/image_pool.py): `util/image_pool.py`

### Other components

- **Research user**

## Connections

- Research user → Try-on test: runs test (evidence: `README.md`)
- Aligned samples → Image transforms: uses transforms (evidence: `data/aligned_dataset_train.py`)
- U-Net models → U-Net blocks: uses blocks (evidence: `models/unet2.py`)
- Garment warping → Feature correlation: uses correlation (evidence: `models/afwm.py`)
- Try-on test → Runtime options: reads options
- Try-on test → Test samples: loads samples
- Try-on test → Garment warping: warps garment
- Try-on test → U-Net models: runs segmentation
- Try-on test → Image networks: runs networks
- Try-on test → Occlusion masks: uses occlusion masks
- Try-on test → Image conversion: converts output
- Try-on test → Try-on image: produces image
