# vqassessment/dover architecture

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

- Interactive diagram: https://gitdiagram.com/vqassessment/dover
- Repository: https://github.com/vqassessment/dover

## Overview

##### Main Components
- Data & Input Layer:
– Show the “examplar_data_labels” directory contents and “get_divide_dataset” which indicate the presence of datasets and labels.
- Preprocessing & Data Loading:
– Represent the data handling utilities and dataset modules from “dover/datasets/…”. This module is responsible for reading video files, applying necessary preprocessing, and managing labels.
- Model Core & Inference Engine:
– Illustrate the core model components contained in “dover/models/…” including multiple backbones (conv, swin, xclip, etc.), evaluators, and heads.
- Configuration & Variants:
- Training & Transfer Learning Pipeline:
– Include components for training (training_with_divide.py, transfer_learning.py) that update only the head (or both the head and backbone in full fine-tune mode). Emphasize that this uses dataset-specific labels.
- Evaluation & Scoring:
– Include evaluation modules (evaluate_one_video.py, evaluate_a_set_of_videos.py, default_infer.py) that take processed video data, run through the model, and output scores.
- ONNX Conversion & Deployment:
- Visualization & Auxiliary Tools:
– Note the presence of notebooks (Generate_Divergence_Maps_and_gMAD.ipynb) and demo figures for divergence maps and WandB training curves.

##### Relationships and Interactions
- Next, a “Model Core” takes the prepared data, splits it into the two quality assessment streams, and computes both aesthetic and technical scores.
- The “Evaluation Module” (driven via scripts like evaluate_one_video.py) then processes these outputs to produce final (normalized) quality metrics.
- For training modes, a similar data path branches into the “Training Pipeline” where weights can be updated (using transfer_learning.py or training_with_divide.py) and then re-integrated into the model.

##### Architectural Patterns & Design Principles
- A modular, layered architecture is used. Separate directories for datasets, models, and utilities suggest clear separation of concerns.
- The two-branch structure of the model (disentangling aesthetic and technical qualities) should be indicated.
- Extensibility – numerous configuration files and separate modules for evaluation, training, and conversion indicate that the system is built to be adaptable.
- Mention the use of established frameworks (likely PyTorch, ONNX) and external tools (WandB for visualization).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data & Input Layer
    A["Examplar Data & Labels"]:::dataLayer
    B["Video Inputs (Demo/Custom)"]:::dataLayer

    %% Preprocessing & Data Loading
    subgraph "Preprocessing & Data Loading"
        C["Datasets Module (/dover/datasets/)"]:::preprocess
        D["Data Prep Utilities (get_divide_dataset)"]:::preprocess
    end

    %% Configuration & Variants
    subgraph "Configuration & Variants"
        E["dover.yml"]:::config
        F["dover-mobile.yml"]:::config
        G["divide.yml"]:::config
    end

    %% Model Core & Inference Engine
    subgraph "Model Core & Inference"
        H["DOVER Model Core (Dual Branch)"]:::model
        I["Aesthetic Branch"]:::model
        J["Technical Branch"]:::model
        K["Inference Engine"]:::model
    end

    %% Training & Transfer Learning Pipeline
    subgraph "Training & Transfer Learning"
        L["training_with_divide.py"]:::train
        M["transfer_learning.py"]:::train
    end

    %% Evaluation & Scoring
    subgraph "Evaluation & Scoring"
        N["Evaluation Modules"]:::evaluate
        R["Evaluation Results"]:::evaluate
    end

    %% ONNX Conversion & Deployment
    O["ONNX Conversion"]:::onnx

    %% Visualization & Auxiliary Tools
    subgraph "Visualization & Reporting"
        P["Visualization Notebooks"]:::visualize
        Q["Demo & Results Media"]:::visualize
    end

    %% Connections: Data flow and relationships
    A -->|"feeds"| C
    B -->|"feeds"| C
    D -->|"assists"| C

    E -->|"configures"| H
    F -->|"configures"| H
    G -->|"configures"| H

    C -->|"preprocesses"| H

    H -->|"splits_into"| I
    H -->|"splits_into"| J
    H -->|"for_inference"| K

    K -->|"processes"| N
    N -->|"outputs"| R

    H -->|"exports_to"| O

    C -->|"provides_data"| L
    L -->|"updates"| H
    M -->|"updates"| H

    R -->|"visualizes"| P
    R -->|"visualizes"| Q

    %% Click Events
    click A "https://github.com/vqassessment/dover/tree/master/examplar_data_labels/"
    click B "https://github.com/vqassessment/dover/tree/master/demo/"
    click C "https://github.com/vqassessment/dover/tree/master/dover/datasets/"
    click D "https://github.com/vqassessment/dover/tree/master/get_divide_dataset/"
    click E "https://github.com/vqassessment/dover/blob/master/dover.yml"
    click F "https://github.com/vqassessment/dover/blob/master/dover-mobile.yml"
    click G "https://github.com/vqassessment/dover/blob/master/divide.yml"
    click H "https://github.com/vqassessment/dover/tree/master/dover/models/"
    click K "https://github.com/vqassessment/dover/blob/master/default_infer.py"
    click K "https://github.com/vqassessment/dover/blob/master/evaluate_one_video.py"
    click K "https://github.com/vqassessment/dover/blob/master/evaluate_a_set_of_videos.py"
    click L "https://github.com/vqassessment/dover/blob/master/training_with_divide.py"
    click M "https://github.com/vqassessment/dover/blob/master/transfer_learning.py"
    click N "https://github.com/vqassessment/dover/blob/master/evaluate_one_video.py"
    click N "https://github.com/vqassessment/dover/blob/master/evaluate_a_set_of_videos.py"
    click O "https://github.com/vqassessment/dover/blob/master/convert_to_onnx.py"
    click O "https://github.com/vqassessment/dover/blob/master/onnx_inference.py"
    click P "https://github.com/vqassessment/dover/blob/master/Generate_Divergence_Maps_and_gMAD.ipynb"
    click Q "https://github.com/vqassessment/dover/tree/master/figs/"

    %% Styles
    classDef dataLayer fill:#AED6F1,stroke:#2471A3,stroke-width:2px;
    classDef preprocess fill:#A9DFBF,stroke:#229954,stroke-width:2px;
    classDef config fill:#E6B0AA,stroke:#C0392B,stroke-width:2px;
    classDef model fill:#F9E79F,stroke:#D4AC0D,stroke-width:2px;
    classDef train fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px;
    classDef evaluate fill:#FAD7A0,stroke:#D68910,stroke-width:2px;
    classDef onnx fill:#F5CBA7,stroke:#E67E22,stroke-width:2px;
    classDef visualize fill:#D6EAF8,stroke:#3498DB,stroke-width:2px;
```
