# msm8976/whu-mars architecture

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

- Interactive diagram: https://gitdiagram.com/msm8976/whu-mars
- Repository: https://github.com/msm8976/whu-mars

## Overview

WHU-MARS provides a multispectral aerial-ground person ReID benchmark; CVPR26_UAD implements UAD training and retrieval evaluation. The main workflow configures a run, loads and samples modality-specific images, trains a ViT-based model with identity/metric losses and UAD alignment and prototype objectives, then evaluates retrieval rankings. The README documents ProCA and GPD; processor excerpts show their use. Some evaluation wiring is only partly sampled, so the graph omits unverified test-entry relationships.

Main entry points: [`CVPR26_UAD/train.py`](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/train.py) (Training entry), [`CVPR26_UAD/datasets/make_dataloader.py`](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/datasets/make_dataloader.py) (Data loaders), [`CVPR26_UAD/processor/processor.py`](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/processor/processor.py) (Training processor), [`CVPR26_UAD/model/make_model.py`](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/model/make_model.py) (ReID model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Run setup"]
  node_config["Run configuration<br/>[defaults.py]"]
  node_train_entry["Training entry<br/>[train.py]"]
end

subgraph group_data["Data preparation"]
  node_dataset["WHU-MARS dataset<br/>[whu_mars.py]"]
  node_image_sets["Image datasets<br/>[bases.py]"]
  node_loader["Data loaders<br/>[make_dataloader.py]"]
  node_samplers["Identity samplers<br/>[sampler.py]"]
  node_ddp_sampler["Distributed sampler<br/>[sampler_ddp.py]"]
end

subgraph group_learning["Representation learning"]
  node_model["ReID model<br/>[make_model.py]"]
  node_vit["Vision Transformer<br/>[vit_pytorch.py]"]
  node_losses["Identity and metric losses<br/>[make_loss.py]"]
  node_proca["ProCA alignment<br/>[processor.py]"]
  node_gpd[("GPD prototypes<br/>[processor.py]")]
  node_processor["Training processor<br/>[processor.py]"]
  node_optimizer["Optimizer<br/>[make_optimizer.py]"]
  node_scheduler["Learning-rate schedule"]
end

subgraph group_evaluation["Retrieval evaluation"]
  node_metrics["Retrieval metrics<br/>[metrics.py]"]
  node_reranking["Distance reranking<br/>[reranking.py]"]
end

node_researcher(("Researcher"))

node_researcher -->|"starts training"| node_train_entry
node_train_entry -->|"loads settings"| node_config
node_train_entry -->|"builds loaders"| node_loader
node_loader -->|"loads splits"| node_dataset
node_loader -->|"wraps samples"| node_image_sets
node_loader -->|"uses sampler"| node_samplers
node_loader -->|"uses distributed sampler"| node_ddp_sampler
node_train_entry -->|"builds model"| node_model
node_model -->|"constructs backbone"| node_vit
node_train_entry -->|"builds losses"| node_losses
node_train_entry -->|"builds optimizer"| node_optimizer
node_train_entry -->|"creates schedule"| node_scheduler
node_train_entry -->|"starts training loop"| node_processor
node_processor -->|"computes alignment"| node_proca
node_processor -->|"updates and applies prototypes"| node_gpd
node_processor -->|"evaluates retrieval"| node_metrics
node_metrics -->|"reranks distances"| node_reranking

click node_config "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/config/defaults.py"
click node_train_entry "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/train.py"
click node_dataset "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/datasets/whu_mars.py"
click node_image_sets "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/datasets/bases.py"
click node_loader "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/datasets/make_dataloader.py"
click node_samplers "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/datasets/sampler.py"
click node_ddp_sampler "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/datasets/sampler_ddp.py"
click node_model "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/model/make_model.py"
click node_vit "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/model/backbones/vit_pytorch.py"
click node_losses "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/loss/make_loss.py"
click node_proca "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/processor/processor.py"
click node_gpd "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/processor/processor.py"
click node_processor "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/processor/processor.py"
click node_optimizer "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/solver/make_optimizer.py"
click node_scheduler "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/solver/scheduler_factory.py"
click node_metrics "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/utils/metrics.py"
click node_reranking "https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/utils/reranking.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_config,node_train_entry toneBlue
class node_dataset,node_image_sets,node_loader,node_samplers,node_ddp_sampler toneAmber
class node_model,node_vit,node_losses,node_proca,node_gpd,node_processor,node_optimizer,node_scheduler toneMint
class node_metrics,node_reranking toneRose
class node_researcher toneIndigo
```

## Components

### Run setup

- [Run configuration](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/config/defaults.py): `CVPR26_UAD/config/defaults.py`
- [Training entry](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/train.py): `CVPR26_UAD/train.py`

### Data preparation

- [WHU-MARS dataset](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/datasets/whu_mars.py): `CVPR26_UAD/datasets/whu_mars.py`
- [Image datasets](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/datasets/bases.py): `CVPR26_UAD/datasets/bases.py`
- [Data loaders](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/datasets/make_dataloader.py): `CVPR26_UAD/datasets/make_dataloader.py`
- [Identity samplers](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/datasets/sampler.py): `CVPR26_UAD/datasets/sampler.py`
- [Distributed sampler](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/datasets/sampler_ddp.py): `CVPR26_UAD/datasets/sampler_ddp.py`

### Representation learning

- [ReID model](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/model/make_model.py): `CVPR26_UAD/model/make_model.py`
- [Vision Transformer](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/model/backbones/vit_pytorch.py): `CVPR26_UAD/model/backbones/vit_pytorch.py`
- [Identity and metric losses](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/loss/make_loss.py): `CVPR26_UAD/loss/make_loss.py`
- [ProCA alignment](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/processor/processor.py): `CVPR26_UAD/processor/processor.py`
- [GPD prototypes](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/processor/processor.py): `CVPR26_UAD/processor/processor.py`
- [Training processor](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/processor/processor.py): `CVPR26_UAD/processor/processor.py`
- [Optimizer](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/solver/make_optimizer.py): `CVPR26_UAD/solver/make_optimizer.py`
- [Learning-rate schedule](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/solver/scheduler_factory.py): `CVPR26_UAD/solver/scheduler_factory.py`

### Retrieval evaluation

- [Retrieval metrics](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/utils/metrics.py): `CVPR26_UAD/utils/metrics.py`
- [Distance reranking](https://github.com/msm8976/whu-mars/blob/main/CVPR26_UAD/utils/reranking.py): `CVPR26_UAD/utils/reranking.py`

### Other components

- **Researcher**

## Connections

- Researcher → Training entry: starts training (evidence: `CVPR26_UAD/train.py`)
- Training entry → Run configuration: loads settings (evidence: `CVPR26_UAD/train.py`)
- Training entry → Data loaders: builds loaders (evidence: `CVPR26_UAD/train.py`)
- Data loaders → WHU-MARS dataset: loads splits (evidence: `CVPR26_UAD/datasets/make_dataloader.py`)
- Data loaders → Image datasets: wraps samples (evidence: `CVPR26_UAD/datasets/make_dataloader.py`)
- Data loaders → Identity samplers: uses sampler (evidence: `CVPR26_UAD/datasets/make_dataloader.py`)
- Data loaders → Distributed sampler: uses distributed sampler (evidence: `CVPR26_UAD/datasets/make_dataloader.py`)
- Training entry → ReID model: builds model (evidence: `CVPR26_UAD/train.py`)
- ReID model → Vision Transformer: constructs backbone (evidence: `CVPR26_UAD/model/make_model.py`)
- Training entry → Identity and metric losses: builds losses (evidence: `CVPR26_UAD/train.py`)
- Training entry → Optimizer: builds optimizer (evidence: `CVPR26_UAD/train.py`)
- Training entry → Learning-rate schedule: creates schedule (evidence: `CVPR26_UAD/train.py`)
- Training entry → Training processor: starts training loop (evidence: `CVPR26_UAD/train.py`)
- Training processor → ProCA alignment: computes alignment (evidence: `CVPR26_UAD/processor/processor.py`)
- Training processor → GPD prototypes: updates and applies prototypes (evidence: `CVPR26_UAD/processor/processor.py`)
- Training processor → Retrieval metrics: evaluates retrieval (evidence: `CVPR26_UAD/processor/processor.py`)
- Retrieval metrics → Distance reranking: reranks distances (evidence: `CVPR26_UAD/utils/metrics.py`)
