# ladaapp/lada architecture

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

- Interactive diagram: https://gitdiagram.com/ladaapp/lada
- Repository: https://github.com/ladaapp/lada

## Overview

Lada restores mosaicked video through either a CLI or GUI: a selected video is processed frame-by-frame, with mosaic detection and restoration, then watched in real time or exported. The graph also preserves the GUI playback path and the two restoration backends. Dataset-generation and training tools are omitted as supporting workflows, not user-facing runtime stages. Evidence is limited to the README and sampled excerpts/SOURCE INDEX references; uncertain internal wiring is left out.

Main entry points: [`lada/restorationpipeline/frame_restorer.py`](https://github.com/ladaapp/lada/blob/main/lada/restorationpipeline/frame_restorer.py) (Frame restoration), [`lada/cli/main.py`](https://github.com/ladaapp/lada/blob/main/lada/cli/main.py) (CLI), [`lada/gui/watch/gstreamer_pipeline_appsrc.py`](https://github.com/ladaapp/lada/blob/main/lada/gui/watch/gstreamer_pipeline_appsrc.py) (Restored-frame source), [`lada/gui/application.py`](https://github.com/ladaapp/lada/blob/main/lada/gui/application.py) (GUI application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_cli["CLI<br/>[main.py]"]
  node_gui["GUI application<br/>[application.py]"]
end

subgraph group_playback["GUI playback and export"]
  node_watch["Video watch view<br/>[watch_view.py]"]
  node_gst["GStreamer playback"]
  node_appsrc["Restored-frame source"]
  node_provider["Restorer provider"]
  node_export["Video export<br/>[export_view.py]"]
end

subgraph group_restore["Restoration pipeline"]
  node_restorer["Frame restoration<br/>[frame_restorer.py]"]
  node_mosaic["Mosaic detection<br/>[mosaic_detector.py]"]
  node_basic["BasicVSR++ restorer"]
  node_deep["DeepMosaics restorer"]
  node_videoio["Video I/O<br/>[video_utils.py]"]
end

subgraph group_models["Detection and restoration models"]
  node_yolo["YOLO segmentation"]
  node_basicmodel["BasicVSR++ inference<br/>[inference.py]"]
  node_deepmodel["DeepMosaics inference<br/>[inference.py]"]
end

node_user(("Video user"))
node_output["Restored video file"]

node_user -->|"submits video"| node_cli
node_user -->|"opens video"| node_gui
node_gui -->|"binds settings"| node_watch
node_user -->|"requests export"| node_export
node_cli -->|"restores frames"| node_restorer
node_provider -->|"creates"| node_restorer
node_appsrc -->|"gets restorer"| node_provider
node_appsrc -->|"reads restored frames"| node_restorer
node_gst -.->|"uses frame source"| node_appsrc
node_restorer -->|"uses detector"| node_mosaic
node_restorer -->|"dispatches restoration"| node_basic
node_restorer -->|"dispatches restoration"| node_deep
node_mosaic -->|"runs segmentation"| node_yolo
node_basic -.->|"runs inference"| node_basicmodel
node_deep -.->|"runs inference"| node_deepmodel
node_restorer -->|"reads video"| node_videoio
node_cli -->|"writes output"| node_videoio
node_export -->|"exports video"| node_output
node_cli -->|"exports video"| node_output

click node_cli "https://github.com/ladaapp/lada/blob/main/lada/cli/main.py"
click node_gui "https://github.com/ladaapp/lada/blob/main/lada/gui/application.py"
click node_watch "https://github.com/ladaapp/lada/blob/main/lada/gui/watch/watch_view.py"
click node_gst "https://github.com/ladaapp/lada/blob/main/lada/gui/watch/gstreamer_pipeline_manager.py"
click node_appsrc "https://github.com/ladaapp/lada/blob/main/lada/gui/watch/gstreamer_pipeline_appsrc.py"
click node_provider "https://github.com/ladaapp/lada/blob/main/lada/gui/frame_restorer_provider.py"
click node_export "https://github.com/ladaapp/lada/blob/main/lada/gui/export/export_view.py"
click node_restorer "https://github.com/ladaapp/lada/blob/main/lada/restorationpipeline/frame_restorer.py"
click node_mosaic "https://github.com/ladaapp/lada/blob/main/lada/restorationpipeline/mosaic_detector.py"
click node_basic "https://github.com/ladaapp/lada/blob/main/lada/restorationpipeline/basicvsrpp_mosaic_restorer.py"
click node_deep "https://github.com/ladaapp/lada/blob/main/lada/restorationpipeline/deepmosaics_mosaic_restorer.py"
click node_yolo "https://github.com/ladaapp/lada/blob/main/lada/models/yolo/yolo11_segmentation_model.py"
click node_basicmodel "https://github.com/ladaapp/lada/blob/main/lada/models/basicvsrpp/inference.py"
click node_deepmodel "https://github.com/ladaapp/lada/blob/main/lada/models/deepmosaics/inference.py"
click node_videoio "https://github.com/ladaapp/lada/blob/main/lada/utils/video_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_cli,node_gui,node_user toneBlue
class node_watch,node_gst,node_appsrc,node_provider,node_export toneAmber
class node_restorer,node_mosaic,node_basic,node_deep,node_videoio toneMint
class node_yolo,node_basicmodel,node_deepmodel toneRose
class node_output toneIndigo
```

## Components

### User entry points

- [CLI](https://github.com/ladaapp/lada/blob/main/lada/cli/main.py): `lada/cli/main.py`
- [GUI application](https://github.com/ladaapp/lada/blob/main/lada/gui/application.py): `lada/gui/application.py`

### GUI playback and export

- [Video watch view](https://github.com/ladaapp/lada/blob/main/lada/gui/watch/watch_view.py): `lada/gui/watch/watch_view.py`
- [GStreamer playback](https://github.com/ladaapp/lada/blob/main/lada/gui/watch/gstreamer_pipeline_manager.py): `lada/gui/watch/gstreamer_pipeline_manager.py`
- [Restored-frame source](https://github.com/ladaapp/lada/blob/main/lada/gui/watch/gstreamer_pipeline_appsrc.py): `lada/gui/watch/gstreamer_pipeline_appsrc.py`
- [Restorer provider](https://github.com/ladaapp/lada/blob/main/lada/gui/frame_restorer_provider.py): `lada/gui/frame_restorer_provider.py`
- [Video export](https://github.com/ladaapp/lada/blob/main/lada/gui/export/export_view.py): `lada/gui/export/export_view.py`

### Restoration pipeline

- [Frame restoration](https://github.com/ladaapp/lada/blob/main/lada/restorationpipeline/frame_restorer.py): `lada/restorationpipeline/frame_restorer.py`
- [Mosaic detection](https://github.com/ladaapp/lada/blob/main/lada/restorationpipeline/mosaic_detector.py): `lada/restorationpipeline/mosaic_detector.py`
- [BasicVSR++ restorer](https://github.com/ladaapp/lada/blob/main/lada/restorationpipeline/basicvsrpp_mosaic_restorer.py): `lada/restorationpipeline/basicvsrpp_mosaic_restorer.py`
- [DeepMosaics restorer](https://github.com/ladaapp/lada/blob/main/lada/restorationpipeline/deepmosaics_mosaic_restorer.py): `lada/restorationpipeline/deepmosaics_mosaic_restorer.py`
- [Video I/O](https://github.com/ladaapp/lada/blob/main/lada/utils/video_utils.py): `lada/utils/video_utils.py`

### Detection and restoration models

- [YOLO segmentation](https://github.com/ladaapp/lada/blob/main/lada/models/yolo/yolo11_segmentation_model.py): `lada/models/yolo/yolo11_segmentation_model.py`
- [BasicVSR++ inference](https://github.com/ladaapp/lada/blob/main/lada/models/basicvsrpp/inference.py): `lada/models/basicvsrpp/inference.py`
- [DeepMosaics inference](https://github.com/ladaapp/lada/blob/main/lada/models/deepmosaics/inference.py): `lada/models/deepmosaics/inference.py`

### Other components

- **Video user**
- **Restored video file**

## Connections

- Video user → CLI: submits video
- Video user → GUI application: opens video
- GUI application → Video watch view: binds settings (evidence: `lada/gui/application.py`)
- Video user → Video export: requests export
- CLI → Frame restoration: restores frames (evidence: `lada/cli/main.py`)
- Restorer provider → Frame restoration: creates (evidence: `lada/gui/frame_restorer_provider.py`)
- Restored-frame source → Restorer provider: gets restorer (evidence: `lada/gui/watch/gstreamer_pipeline_appsrc.py`)
- Restored-frame source → Frame restoration: reads restored frames (evidence: `lada/gui/watch/gstreamer_pipeline_appsrc.py`)
- GStreamer playback → Restored-frame source: uses frame source (evidence: `lada/gui/watch/gstreamer_pipeline_manager.py`)
- Frame restoration → Mosaic detection: uses detector (evidence: `lada/restorationpipeline/frame_restorer.py`)
- Frame restoration → BasicVSR++ restorer: dispatches restoration (evidence: `lada/restorationpipeline/frame_restorer.py`)
- Frame restoration → DeepMosaics restorer: dispatches restoration (evidence: `lada/restorationpipeline/frame_restorer.py`)
- Mosaic detection → YOLO segmentation: runs segmentation (evidence: `lada/restorationpipeline/mosaic_detector.py`)
- BasicVSR++ restorer → BasicVSR++ inference: runs inference
- DeepMosaics restorer → DeepMosaics inference: runs inference
- Frame restoration → Video I/O: reads video (evidence: `lada/restorationpipeline/frame_restorer.py`)
- CLI → Video I/O: writes output (evidence: `lada/cli/main.py`)
- Video export → Restored video file: exports video
- CLI → Restored video file: exports video
