# cxjyxxme/deep-online-video-stabilization architecture

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

- Interactive diagram: https://gitdiagram.com/cxjyxxme/deep-online-video-stabilization
- Repository: https://github.com/cxjyxxme/deep-online-video-stabilization

## Overview

This repository implements deep online video stabilization: it learns multi-grid image warps and applies them to unstable video frames, producing stabilized video and optional visualizations. The main user path is to provide a test list, video inputs, and a trained checkpoint to the deployment script; training is a separate path that builds the stabilization network and optimizes it from frame, flow, and feature-match data. The excerpts show the model’s warp and loss components, but not all deployment graph construction or training-data wiring, so uncertain links are omitted.

Main entry points: [`deploy_bundle.py`](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/deploy_bundle.py) (Deploy runner), [`s_net_bundle_nobm.py`](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/s_net_bundle_nobm.py) (Stabilization network), [`train_bundle_nobm.py`](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/train_bundle_nobm.py) (Training runner), [`get_data_mini_after.py`](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/get_data_mini_after.py) (Sequence reader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deploy["Video deployment"]
  node_deployment["Deploy runner<br/>[deploy_bundle.py]"]
end

subgraph group_training["Model training"]
  node_trainer["Training runner"]
  node_settings["Training settings<br/>[v2_93.py]"]
end

subgraph group_data["Training data"]
  node_datareader["Sequence reader"]
  node_legacyreader["Basic reader<br/>[get_data.py]"]
  node_featuredata["Feature matches<br/>[feature_fetcher.py]"]
end

subgraph group_model["Warp model"]
  node_stabilizer["Stabilization network"]
  node_resnet["ResNet layers<br/>[resnet.py]"]
  node_tensorhelpers["Tensor helpers<br/>[tf_utils.py]"]
  node_warper["Grid transformer"]
  node_spatialbase["Spatial interpolation"]
end

node_operator(("Video operator"))
node_testlist["Test list"]
node_unstablevideo["Unstable video"]
node_checkpoint["Model checkpoint"]
node_stabilizedvideo["Stabilized video"]
node_visualization["Visual output"]

node_operator -->|"runs"| node_deployment
node_testlist -->|"selects videos"| node_deployment
node_unstablevideo -->|"reads frames"| node_deployment
node_checkpoint -->|"restores weights"| node_deployment
node_deployment -->|"writes video"| node_stabilizedvideo
node_deployment -.->|"writes visuals"| node_visualization
node_settings -->|"configures"| node_trainer
node_trainer -->|"builds network"| node_stabilizer
node_trainer -->|"optimizes losses"| node_stabilizer
node_datareader -->|"provides batches"| node_trainer
node_legacyreader -->|"reads records"| node_unstablevideo
node_featuredata -->|"fetches matches"| node_datareader
node_stabilizer -->|"warps frames"| node_warper
node_stabilizer -->|"uses layers"| node_resnet
node_stabilizer -->|"uses helpers"| node_tensorhelpers
node_spatialbase --> node_operator

click node_deployment "https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/deploy_bundle.py"
click node_trainer "https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/train_bundle_nobm.py"
click node_settings "https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/configs/v2_93.py"
click node_datareader "https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/get_data_mini_after.py"
click node_legacyreader "https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/get_data.py"
click node_featuredata "https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/feature_fetcher.py"
click node_stabilizer "https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/s_net_bundle_nobm.py"
click node_resnet "https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/resnet.py"
click node_tensorhelpers "https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/tf_utils.py"
click node_warper "https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/spatial_transformer3.py"
click node_spatialbase "https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/spatial_transformer.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_deployment toneBlue
class node_trainer,node_settings toneAmber
class node_datareader,node_legacyreader,node_featuredata toneMint
class node_stabilizer,node_resnet,node_tensorhelpers,node_warper,node_spatialbase toneRose
class node_operator,node_testlist,node_unstablevideo,node_checkpoint,node_stabilizedvideo,node_visualization toneIndigo
```

## Components

### Video deployment

- [Deploy runner](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/deploy_bundle.py): `deploy_bundle.py`

### Model training

- [Training runner](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/train_bundle_nobm.py): `train_bundle_nobm.py`
- [Training settings](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/configs/v2_93.py): `configs/v2_93.py`

### Training data

- [Sequence reader](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/get_data_mini_after.py): `get_data_mini_after.py`
- [Basic reader](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/get_data.py): `get_data.py`
- [Feature matches](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/feature_fetcher.py): `feature_fetcher.py`

### Warp model

- [Stabilization network](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/s_net_bundle_nobm.py): `s_net_bundle_nobm.py`
- [ResNet layers](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/resnet.py): `resnet.py`
- [Tensor helpers](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/tf_utils.py): `tf_utils.py`
- [Grid transformer](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/spatial_transformer3.py): `spatial_transformer3.py`
- [Spatial interpolation](https://github.com/cxjyxxme/deep-online-video-stabilization/blob/master/spatial_transformer.py): `spatial_transformer.py`

### Other components

- **Video operator**
- **Test list**
- **Unstable video**
- **Model checkpoint**
- **Stabilized video**
- **Visual output**

## Connections

- Video operator → Deploy runner: runs
- Test list → Deploy runner: selects videos
- Unstable video → Deploy runner: reads frames
- Model checkpoint → Deploy runner: restores weights
- Deploy runner → Stabilized video: writes video
- Deploy runner → Visual output: writes visuals
- Training settings → Training runner: configures
- Training runner → Stabilization network: builds network
- Training runner → Stabilization network: optimizes losses
- Sequence reader → Training runner: provides batches
- Basic reader → Unstable video: reads records
- Feature matches → Sequence reader: fetches matches
- Stabilization network → Grid transformer: warps frames
- Stabilization network → ResNet layers: uses layers
- Stabilization network → Tensor helpers: uses helpers
- Spatial interpolation → Video operator
