# hutsulruslan/cvs_with_real_time_video_processing architecture

> Architecture diagram of the GitHub repository hutsulruslan/cvs_with_real_time_video_processing, 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/hutsulruslan/cvs_with_real_time_video_processing
- Repository: https://github.com/hutsulruslan/cvs_with_real_time_video_processing

## Overview

Edge Vision is a local video object-detection application for Linux edge devices. Its main workflow loads configured inputs, reads camera or file frames, preprocesses each frame, runs mock or optional TFLite inference, postprocesses detections, and presents results in a window or optionally saves them. Frame skipping can reuse recent detections; metrics and performance reporting support monitoring runs. The graph follows the sampled pipeline and application code plus README capabilities; wiring for unsampled configuration, factory, CLI, and reporting components is shown only where documented capabilities support it.

Main entry points: [`src/edge_vision/app/application_factory.py`](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/app/application_factory.py) (Application factory), [`src/edge_vision/app/pipeline.py`](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/app/pipeline.py) (Frame pipeline), [`src/edge_vision/app/application.py`](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/app/application.py) (Application loop), [`src/edge_vision/app/runner.py`](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/app/runner.py) (CLI runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_main["CLI entry<br/>[main.py]"]
  node_runner["CLI runner<br/>[runner.py]"]
  node_application["Application loop<br/>[application.py]"]
  node_pipeline["Frame pipeline<br/>[pipeline.py]"]
  node_factory["Application factory"]
end

subgraph group_inputs["Video inputs"]
  node_camera["Camera source"]
  node_file["Video file source"]
  node_stream["Video stream source"]
  node_source_factory["Source factory<br/>[source_factory.py]"]
end

subgraph group_vision["Vision pipeline"]
  node_preprocessor["Frame preprocessing<br/>[preprocessor.py]"]
  node_lowlight["Low-light enhancement<br/>[low_light.py]"]
  node_mock_detector["Mock detector<br/>[mock_detector.py]"]
  node_tflite["TFLite detector<br/>[tflite_detector.py]"]
  node_model_loader["Model loader<br/>[model_loader.py]"]
  node_postprocessor["Detection postprocessing<br/>[postprocessor.py]"]
  node_metrics["FPS and profiling<br/>[fps_counter.py]"]
  node_profiler["Section profiler<br/>[profiler.py]"]
end

subgraph group_outputs["Results and display"]
  node_report["Performance report"]
  node_renderer["Frame renderer<br/>[renderer.py]"]
  node_display["Window display<br/>[window_display.py]"]
  node_writer["Result writer<br/>[result_writer.py]"]
  node_writer_factory["Writer factory<br/>[writer_factory.py]"]
  node_csv["CSV writer<br/>[csv_writer.py]"]
  node_json["JSON writer<br/>[json_writer.py]"]
end

subgraph group_configuration["Configuration and tools"]
  node_config["Settings loader<br/>[config_loader.py]"]
  node_settings["Runtime settings<br/>[settings.py]"]
  node_camera_probe["Camera probe<br/>[camera_probe.py]"]
end

node_operator(("Operator"))

node_operator -->|"starts"| node_main
node_main -->|"calls"| node_runner
node_runner -->|"loads settings"| node_config
node_config -->|"builds"| node_settings
node_runner -->|"builds application"| node_factory
node_factory -->|"uses settings"| node_settings
node_factory -->|"selects source"| node_source_factory
node_source_factory -->|"creates camera"| node_camera
node_source_factory -->|"creates file source"| node_file
node_source_factory -->|"creates stream"| node_stream
node_factory -.->|"selects mock"| node_mock_detector
node_factory -.->|"selects TFLite"| node_tflite
node_tflite -->|"loads runtime"| node_model_loader
node_factory -->|"configures"| node_preprocessor
node_preprocessor -->|"enhances frames"| node_lowlight
node_factory -->|"configures"| node_postprocessor
node_factory -->|"configures"| node_metrics
node_factory -->|"configures"| node_profiler
node_factory -->|"configures"| node_renderer
node_factory -->|"configures"| node_display
node_factory -.->|"configures optional saving"| node_writer_factory
node_writer_factory -->|"creates CSV writer"| node_csv
node_writer_factory -->|"creates JSON writer"| node_json
node_factory -->|"creates"| node_application
node_application -->|"opens and reads"| node_camera
node_application -->|"processes frames"| node_pipeline
node_pipeline -->|"preprocesses"| node_preprocessor
node_pipeline -.->|"detects"| node_mock_detector
node_pipeline -.->|"detects"| node_tflite
node_pipeline -->|"postprocesses"| node_postprocessor
node_pipeline -->|"updates FPS"| node_metrics
node_pipeline -->|"records timings"| node_profiler
node_application -.->|"writes results"| node_writer
node_application -->|"renders results"| node_renderer
node_application -->|"shows frame"| node_display
node_runner -->|"reports run metrics"| node_report
node_operator -->|"probes cameras"| node_camera_probe

click node_main "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/main.py"
click node_runner "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/app/runner.py"
click node_application "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/app/application.py"
click node_pipeline "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/app/pipeline.py"
click node_config "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/config/config_loader.py"
click node_settings "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/config/settings.py"
click node_factory "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/app/application_factory.py"
click node_camera "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/video/opencv_camera_source.py"
click node_file "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/video/video_file_source.py"
click node_stream "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/video/video_stream_source.py"
click node_source_factory "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/video/source_factory.py"
click node_preprocessor "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/preprocessing/preprocessor.py"
click node_lowlight "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/preprocessing/low_light.py"
click node_mock_detector "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/inference/mock_detector.py"
click node_tflite "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/inference/tflite_detector.py"
click node_model_loader "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/inference/model_loader.py"
click node_postprocessor "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/postprocessing/postprocessor.py"
click node_metrics "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/metrics/fps_counter.py"
click node_profiler "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/metrics/profiler.py"
click node_report "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/metrics/performance_report.py"
click node_renderer "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/visualization/renderer.py"
click node_display "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/visualization/window_display.py"
click node_writer "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/storage/result_writer.py"
click node_writer_factory "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/storage/writer_factory.py"
click node_csv "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/storage/csv_writer.py"
click node_json "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/storage/json_writer.py"
click node_camera_probe "https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/tools/camera_probe.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_main,node_runner,node_application,node_pipeline,node_factory toneBlue
class node_camera,node_file,node_stream,node_source_factory toneAmber
class node_preprocessor,node_lowlight,node_mock_detector,node_tflite,node_model_loader,node_postprocessor,node_metrics,node_profiler toneMint
class node_report,node_renderer,node_display,node_writer,node_writer_factory,node_csv,node_json toneRose
class node_config,node_settings,node_camera_probe,node_operator toneIndigo
```

## Components

### Application runtime

- [CLI entry](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/main.py): `main.py`
- [CLI runner](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/app/runner.py): `src/edge_vision/app/runner.py`
- [Application loop](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/app/application.py): `src/edge_vision/app/application.py`
- [Frame pipeline](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/app/pipeline.py): `src/edge_vision/app/pipeline.py`
- [Application factory](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/app/application_factory.py): `src/edge_vision/app/application_factory.py`

### Video inputs

- [Camera source](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/video/opencv_camera_source.py): `src/edge_vision/video/opencv_camera_source.py`
- [Video file source](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/video/video_file_source.py): `src/edge_vision/video/video_file_source.py`
- [Video stream source](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/video/video_stream_source.py): `src/edge_vision/video/video_stream_source.py`
- [Source factory](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/video/source_factory.py): `src/edge_vision/video/source_factory.py`

### Vision pipeline

- [Frame preprocessing](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/preprocessing/preprocessor.py): `src/edge_vision/preprocessing/preprocessor.py`
- [Low-light enhancement](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/preprocessing/low_light.py): `src/edge_vision/preprocessing/low_light.py`
- [Mock detector](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/inference/mock_detector.py): `src/edge_vision/inference/mock_detector.py`
- [TFLite detector](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/inference/tflite_detector.py): `src/edge_vision/inference/tflite_detector.py`
- [Model loader](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/inference/model_loader.py): `src/edge_vision/inference/model_loader.py`
- [Detection postprocessing](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/postprocessing/postprocessor.py): `src/edge_vision/postprocessing/postprocessor.py`
- [FPS and profiling](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/metrics/fps_counter.py): `src/edge_vision/metrics/fps_counter.py`
- [Section profiler](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/metrics/profiler.py): `src/edge_vision/metrics/profiler.py`

### Results and display

- [Performance report](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/metrics/performance_report.py): `src/edge_vision/metrics/performance_report.py`
- [Frame renderer](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/visualization/renderer.py): `src/edge_vision/visualization/renderer.py`
- [Window display](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/visualization/window_display.py): `src/edge_vision/visualization/window_display.py`
- [Result writer](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/storage/result_writer.py): `src/edge_vision/storage/result_writer.py`
- [Writer factory](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/storage/writer_factory.py): `src/edge_vision/storage/writer_factory.py`
- [CSV writer](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/storage/csv_writer.py): `src/edge_vision/storage/csv_writer.py`
- [JSON writer](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/storage/json_writer.py): `src/edge_vision/storage/json_writer.py`

### Configuration and tools

- [Settings loader](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/config/config_loader.py): `src/edge_vision/config/config_loader.py`
- [Runtime settings](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/config/settings.py): `src/edge_vision/config/settings.py`
- [Camera probe](https://github.com/hutsulruslan/cvs_with_real_time_video_processing/blob/main/src/edge_vision/tools/camera_probe.py): `src/edge_vision/tools/camera_probe.py`

### Other components

- **Operator**

## Connections

- Operator → CLI entry: starts
- CLI entry → CLI runner: calls
- CLI runner → Settings loader: loads settings
- Settings loader → Runtime settings: builds
- CLI runner → Application factory: builds application
- Application factory → Runtime settings: uses settings
- Application factory → Source factory: selects source
- Source factory → Camera source: creates camera
- Source factory → Video file source: creates file source
- Source factory → Video stream source: creates stream
- Application factory → Mock detector: selects mock
- Application factory → TFLite detector: selects TFLite
- TFLite detector → Model loader: loads runtime
- Application factory → Frame preprocessing: configures
- Frame preprocessing → Low-light enhancement: enhances frames
- Application factory → Detection postprocessing: configures
- Application factory → FPS and profiling: configures
- Application factory → Section profiler: configures
- Application factory → Frame renderer: configures
- Application factory → Window display: configures
- Application factory → Writer factory: configures optional saving
- Writer factory → CSV writer: creates CSV writer
- Writer factory → JSON writer: creates JSON writer
- Application factory → Application loop: creates
- Application loop → Camera source: opens and reads
- Application loop → Frame pipeline: processes frames
- Frame pipeline → Frame preprocessing: preprocesses
- Frame pipeline → Mock detector: detects
- Frame pipeline → TFLite detector: detects
- Frame pipeline → Detection postprocessing: postprocesses
- Frame pipeline → FPS and profiling: updates FPS
- Frame pipeline → Section profiler: records timings
- Application loop → Result writer: writes results
- Application loop → Frame renderer: renders results
- Application loop → Window display: shows frame
- CLI runner → Performance report: reports run metrics
- Operator → Camera probe: probes cameras
