# zhengchen1999/dove architecture

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

- Interactive diagram: https://gitdiagram.com/zhengchen1999/dove
- Repository: https://github.com/zhengchen1999/dove

## Overview

DOVE is a one-step diffusion system for real-world video super-resolution, with training, inference, and restoration-quality evaluation. Its training workflow prepares image/video examples, applies synthetic degradation, and trains staged DOVE variants through a shared trainer; inference produces restored video, while a separate metrics CLI evaluates existing results. The README documents the broader capabilities, but sampled inference and several training/evaluation sources are incomplete, so uncertain runtime links are omitted or marked unverified.

Main entry points: [`metrics/cli.py`](https://github.com/zhengchen1999/dove/blob/main/metrics/cli.py) (Metric Evaluation CLI), [`finetune/trainer.py`](https://github.com/zhengchen1999/dove/blob/main/finetune/trainer.py) (Training Orchestrator), [`finetune/train.py`](https://github.com/zhengchen1999/dove/blob/main/finetune/train.py) (Training Entry), [`metrics/ewarp.py`](https://github.com/zhengchen1999/dove/blob/main/metrics/ewarp.py) (eWarp Metric)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Training"]
  node_training_args["Training Configuration<br/>[args.py]"]
  node_training_data[("Video and Image Datasets")]
  node_degradation["Synthetic Degradation<br/>[degradation.py]"]
  node_blur_kernels["Blur Kernels<br/>[blur_kernels.py]"]
  node_trainer_core["Training Orchestrator<br/>[trainer.py]"]
  node_optimizer["Optimizer Utilities<br/>[optimizer_utils.py]"]
  node_checkpointing["Checkpointing<br/>[checkpointing.py]"]
  node_train_entry["Training Entry<br/>[train.py]"]
end

subgraph group_model["DOVE Model"]
  node_stage1_trainer["Stage One Trainer"]
  node_stage2_trainer["Stage Two Trainer"]
  node_sft_trainers["SFT Trainers"]
  node_model_registry["Trainer Registry<br/>[utils.py]"]
end

subgraph group_inference["Inference"]
  node_inference_entry["Video Super-Resolution"]
end

subgraph group_evaluation["Evaluation"]
  node_metric_cli["Metric Evaluation CLI<br/>[cli.py]"]
  node_metric_io["Sequence Input Handling<br/>[io.py]"]
  node_image_metrics["Image Quality Metrics<br/>[iqa.py]"]
  node_ewarp_metric["eWarp Metric<br/>[ewarp.py]"]
  node_video_metrics["Video Metrics<br/>[video.py]"]
  node_raft_ewarp["RAFT eWarp Computation<br/>[ewarp.py]"]
  node_raft_network["RAFT Flow Network<br/>[raft.py]"]
  node_raft_encoder["RAFT Feature Encoder<br/>[extractor.py]"]
  node_warp_utils["Warp Utilities<br/>[warp_utils.py]"]
end

node_researcher(("Researcher"))
node_external_metrics["DOVER / VBench"]

node_researcher -.->|"starts training"| node_train_entry
node_train_entry -->|"loads arguments"| node_training_args
node_train_entry -->|"selects trainer"| node_model_registry
node_model_registry -->|"registers trainers"| node_trainer_core
node_stage1_trainer -->|"extends"| node_trainer_core
node_stage2_trainer -->|"extends"| node_trainer_core
node_sft_trainers -.->|"stage training"| node_trainer_core
node_trainer_core -->|"loads datasets"| node_training_data
node_training_data -->|"applies degradation"| node_degradation
node_degradation -->|"uses kernels"| node_blur_kernels
node_trainer_core -.->|"uses utilities"| node_optimizer
node_trainer_core -.->|"saves checkpoints"| node_checkpointing
node_researcher -.->|"provides video"| node_inference_entry
node_inference_entry -.->|"evaluates outputs"| node_metric_cli
node_researcher -->|"evaluates results"| node_metric_cli
node_metric_cli -->|"discovers sequences"| node_metric_io
node_metric_cli -->|"computes IQA"| node_image_metrics
node_metric_cli -->|"computes eWarp"| node_ewarp_metric
node_metric_cli -->|"computes video scores"| node_video_metrics
node_metric_cli -.->|"supports metrics"| node_external_metrics
node_ewarp_metric -->|"loads sequences"| node_metric_io
node_ewarp_metric -->|"delegates scoring"| node_raft_ewarp
node_raft_ewarp -->|"estimates flow"| node_raft_network
node_raft_ewarp -->|"warps frames"| node_warp_utils
node_raft_network -->|"extracts features"| node_raft_encoder
node_video_metrics -->|"reads inputs"| node_metric_io

click node_training_args "https://github.com/zhengchen1999/dove/blob/main/finetune/schemas/args.py"
click node_training_data "https://github.com/zhengchen1999/dove/blob/main/finetune/datasets/real_sr_image_video_dataset.py"
click node_degradation "https://github.com/zhengchen1999/dove/blob/main/finetune/datasets/degradation.py"
click node_blur_kernels "https://github.com/zhengchen1999/dove/blob/main/finetune/datasets/blur_kernels.py"
click node_trainer_core "https://github.com/zhengchen1999/dove/blob/main/finetune/trainer.py"
click node_optimizer "https://github.com/zhengchen1999/dove/blob/main/finetune/utils/optimizer_utils.py"
click node_checkpointing "https://github.com/zhengchen1999/dove/blob/main/finetune/utils/checkpointing.py"
click node_stage1_trainer "https://github.com/zhengchen1999/dove/blob/main/finetune/models/dove/lora_one_s1_trainer.py"
click node_stage2_trainer "https://github.com/zhengchen1999/dove/blob/main/finetune/models/dove/lora_one_s2_trainer.py"
click node_sft_trainers "https://github.com/zhengchen1999/dove/blob/main/finetune/models/dove/sft_one_s1_trainer.py"
click node_model_registry "https://github.com/zhengchen1999/dove/blob/main/finetune/models/utils.py"
click node_train_entry "https://github.com/zhengchen1999/dove/blob/main/finetune/train.py"
click node_inference_entry "https://github.com/zhengchen1999/dove/blob/main/inference_script.py"
click node_metric_cli "https://github.com/zhengchen1999/dove/blob/main/metrics/cli.py"
click node_metric_io "https://github.com/zhengchen1999/dove/blob/main/metrics/io.py"
click node_image_metrics "https://github.com/zhengchen1999/dove/blob/main/metrics/iqa.py"
click node_ewarp_metric "https://github.com/zhengchen1999/dove/blob/main/metrics/ewarp.py"
click node_video_metrics "https://github.com/zhengchen1999/dove/blob/main/metrics/video.py"
click node_raft_ewarp "https://github.com/zhengchen1999/dove/blob/main/metrics/raft/ewarp.py"
click node_raft_network "https://github.com/zhengchen1999/dove/blob/main/metrics/raft/core/raft.py"
click node_raft_encoder "https://github.com/zhengchen1999/dove/blob/main/metrics/raft/core/extractor.py"
click node_warp_utils "https://github.com/zhengchen1999/dove/blob/main/metrics/raft/warp_utils.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_training_args,node_training_data,node_degradation,node_blur_kernels,node_trainer_core,node_optimizer,node_checkpointing,node_train_entry toneBlue
class node_stage1_trainer,node_stage2_trainer,node_sft_trainers,node_model_registry toneAmber
class node_inference_entry toneMint
class node_metric_cli,node_metric_io,node_image_metrics,node_ewarp_metric,node_video_metrics,node_raft_ewarp,node_raft_network,node_raft_encoder,node_warp_utils toneRose
class node_researcher,node_external_metrics toneIndigo
```

## Components

### Training

- [Training Configuration](https://github.com/zhengchen1999/dove/blob/main/finetune/schemas/args.py): `finetune/schemas/args.py`
- [Video and Image Datasets](https://github.com/zhengchen1999/dove/blob/main/finetune/datasets/real_sr_image_video_dataset.py): `finetune/datasets/real_sr_image_video_dataset.py`
- [Synthetic Degradation](https://github.com/zhengchen1999/dove/blob/main/finetune/datasets/degradation.py): `finetune/datasets/degradation.py`
- [Blur Kernels](https://github.com/zhengchen1999/dove/blob/main/finetune/datasets/blur_kernels.py): `finetune/datasets/blur_kernels.py`
- [Training Orchestrator](https://github.com/zhengchen1999/dove/blob/main/finetune/trainer.py): `finetune/trainer.py`
- [Optimizer Utilities](https://github.com/zhengchen1999/dove/blob/main/finetune/utils/optimizer_utils.py): `finetune/utils/optimizer_utils.py`
- [Checkpointing](https://github.com/zhengchen1999/dove/blob/main/finetune/utils/checkpointing.py): `finetune/utils/checkpointing.py`
- [Training Entry](https://github.com/zhengchen1999/dove/blob/main/finetune/train.py): `finetune/train.py`

### DOVE Model

- [Stage One Trainer](https://github.com/zhengchen1999/dove/blob/main/finetune/models/dove/lora_one_s1_trainer.py): `finetune/models/dove/lora_one_s1_trainer.py`
- [Stage Two Trainer](https://github.com/zhengchen1999/dove/blob/main/finetune/models/dove/lora_one_s2_trainer.py): `finetune/models/dove/lora_one_s2_trainer.py`
- [SFT Trainers](https://github.com/zhengchen1999/dove/blob/main/finetune/models/dove/sft_one_s1_trainer.py): `finetune/models/dove/sft_one_s1_trainer.py`
- [Trainer Registry](https://github.com/zhengchen1999/dove/blob/main/finetune/models/utils.py): `finetune/models/utils.py`

### Inference

- [Video Super-Resolution](https://github.com/zhengchen1999/dove/blob/main/inference_script.py): `inference_script.py`

### Evaluation

- [Metric Evaluation CLI](https://github.com/zhengchen1999/dove/blob/main/metrics/cli.py): `metrics/cli.py`
- [Sequence Input Handling](https://github.com/zhengchen1999/dove/blob/main/metrics/io.py): `metrics/io.py`
- [Image Quality Metrics](https://github.com/zhengchen1999/dove/blob/main/metrics/iqa.py): `metrics/iqa.py`
- [eWarp Metric](https://github.com/zhengchen1999/dove/blob/main/metrics/ewarp.py): `metrics/ewarp.py`
- [Video Metrics](https://github.com/zhengchen1999/dove/blob/main/metrics/video.py): `metrics/video.py`
- [RAFT eWarp Computation](https://github.com/zhengchen1999/dove/blob/main/metrics/raft/ewarp.py): `metrics/raft/ewarp.py`
- [RAFT Flow Network](https://github.com/zhengchen1999/dove/blob/main/metrics/raft/core/raft.py): `metrics/raft/core/raft.py`
- [RAFT Feature Encoder](https://github.com/zhengchen1999/dove/blob/main/metrics/raft/core/extractor.py): `metrics/raft/core/extractor.py`
- [Warp Utilities](https://github.com/zhengchen1999/dove/blob/main/metrics/raft/warp_utils.py): `metrics/raft/warp_utils.py`

### Other components

- **Researcher**
- **DOVER / VBench**

## Connections

- Researcher → Training Entry: starts training
- Training Entry → Training Configuration: loads arguments (evidence: `finetune/train.py`)
- Training Entry → Trainer Registry: selects trainer (evidence: `finetune/train.py`)
- Trainer Registry → Training Orchestrator: registers trainers (evidence: `finetune/models/utils.py`)
- Stage One Trainer → Training Orchestrator: extends (evidence: `finetune/models/dove/lora_one_s1_trainer.py`)
- Stage Two Trainer → Training Orchestrator: extends (evidence: `finetune/models/dove/lora_one_s2_trainer.py`)
- SFT Trainers → Training Orchestrator: stage training
- Training Orchestrator → Video and Image Datasets: loads datasets (evidence: `finetune/trainer.py`)
- Video and Image Datasets → Synthetic Degradation: applies degradation (evidence: `finetune/datasets/real_sr_image_video_dataset.py`)
- Synthetic Degradation → Blur Kernels: uses kernels (evidence: `finetune/datasets/degradation.py`)
- Training Orchestrator → Optimizer Utilities: uses utilities
- Training Orchestrator → Checkpointing: saves checkpoints
- Researcher → Video Super-Resolution: provides video
- Video Super-Resolution → Metric Evaluation CLI: evaluates outputs
- Researcher → Metric Evaluation CLI: evaluates results (evidence: `metrics/cli.py`)
- Metric Evaluation CLI → Sequence Input Handling: discovers sequences (evidence: `metrics/cli.py`)
- Metric Evaluation CLI → Image Quality Metrics: computes IQA (evidence: `metrics/cli.py`)
- Metric Evaluation CLI → eWarp Metric: computes eWarp (evidence: `metrics/cli.py`)
- Metric Evaluation CLI → Video Metrics: computes video scores (evidence: `metrics/cli.py`)
- Metric Evaluation CLI → DOVER / VBench: supports metrics
- eWarp Metric → Sequence Input Handling: loads sequences (evidence: `metrics/ewarp.py`)
- eWarp Metric → RAFT eWarp Computation: delegates scoring (evidence: `metrics/ewarp.py`)
- RAFT eWarp Computation → RAFT Flow Network: estimates flow (evidence: `metrics/raft/ewarp.py`)
- RAFT eWarp Computation → Warp Utilities: warps frames (evidence: `metrics/raft/ewarp.py`)
- RAFT Flow Network → RAFT Feature Encoder: extracts features (evidence: `metrics/raft/core/raft.py`)
- Video Metrics → Sequence Input Handling: reads inputs (evidence: `metrics/video.py`)
