# shadow12546-sketch/adas-perception-fuzzy-scheduling architecture

> Architecture diagram of the GitHub repository shadow12546-sketch/adas-perception-fuzzy-scheduling, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shadow12546-sketch/adas-perception-fuzzy-scheduling
- Repository: https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling

## Overview

This research prototype processes traffic video into an annotated perception view and a bird’s-eye view, with fixed, fuzzy-scheduled, and profiling run modes. The graph separates video I/O, perception, presentation, and experiment modes. Source excerpts show the fixed and fuzzy orchestration and key module calls; additional capabilities such as fine-tuned detector mapping and schedule logging are retained based on the README and excerpted source. Unsampled implementations are not assumed to have unshown connections.

Main entry points: [`main_fuzzy.py`](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main_fuzzy.py) (Fuzzy pipeline), [`main_profile.py`](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main_profile.py) (Profile pipeline), [`main.py`](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main.py) (Fixed pipeline), [`utils/video.py`](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/utils/video.py) (Video processor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_io["Video I/O"]
  node_video_io["Video processor<br/>[video.py]"]
  node_output_video["Output video"]
end

subgraph group_perception["Perception"]
  node_detector["Object detection"]
  node_lane_detector["Lane detection<br/>[lane_detection.py]"]
  node_depth_estimator["Depth estimation"]
  node_bev["Bird’s-eye projection<br/>[bird_eye_view.py]"]
  node_pipeline_config["Pipeline configuration<br/>[config.py]"]
end

subgraph group_presentation["Visualization"]
  node_visualization["Overlay and composition<br/>[drawing.py]"]
end

subgraph group_experiments["Run Modes"]
  node_fixed_runner["Fixed pipeline<br/>[main.py]"]
  node_fuzzy_runner["Fuzzy pipeline<br/>[main_fuzzy.py]"]
  node_profile_runner["Profile pipeline<br/>[main_profile.py]"]
  node_fuzzy_scheduler["Fuzzy scheduler<br/>[main_fuzzy.py]"]
  node_profile_metrics["Profile metrics<br/>[main_profile.py]"]
  node_schedule_log["Schedule CSV log<br/>[main_fuzzy.py]"]
end

node_traffic_video["Traffic video"]

node_traffic_video -->|"starts with"| node_fixed_runner
node_traffic_video -->|"starts with"| node_fuzzy_runner
node_traffic_video -->|"starts with"| node_profile_runner
node_fixed_runner -->|"reads frames"| node_video_io
node_fixed_runner -->|"detects objects"| node_detector
node_fixed_runner -->|"detects lanes"| node_lane_detector
node_fixed_runner -->|"estimates depth"| node_depth_estimator
node_fixed_runner -->|"projects view"| node_bev
node_fixed_runner -->|"draws and combines"| node_visualization
node_fixed_runner -->|"writes frames"| node_video_io
node_fuzzy_runner -->|"reads frames"| node_video_io
node_fuzzy_runner -->|"detects objects"| node_detector
node_fuzzy_runner -->|"detects lanes"| node_lane_detector
node_fuzzy_runner -->|"chooses interval"| node_fuzzy_scheduler
node_fuzzy_scheduler -->|"schedules calls"| node_depth_estimator
node_fuzzy_runner -->|"projects view"| node_bev
node_fuzzy_runner -->|"draws and combines"| node_visualization
node_fuzzy_runner -->|"writes frames"| node_video_io
node_fuzzy_runner -->|"records decisions"| node_schedule_log
node_profile_runner -->|"reads frames"| node_video_io
node_profile_runner -->|"detects objects"| node_detector
node_profile_runner -->|"detects lanes"| node_lane_detector
node_profile_runner -->|"estimates depth"| node_depth_estimator
node_profile_runner -->|"projects view"| node_bev
node_profile_runner -->|"draws and combines"| node_visualization
node_profile_runner -->|"writes frames"| node_video_io
node_profile_runner -->|"records timings"| node_profile_metrics
node_video_io -.->|"writes video"| node_output_video
node_detector -->|"loads settings"| node_pipeline_config
node_lane_detector -->|"loads settings"| node_pipeline_config

click node_fixed_runner "https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main.py"
click node_fuzzy_runner "https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main_fuzzy.py"
click node_profile_runner "https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main_profile.py"
click node_video_io "https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/utils/video.py"
click node_detector "https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/modules/object_detection.py"
click node_lane_detector "https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/modules/lane_detection.py"
click node_depth_estimator "https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/modules/depth_estimation.py"
click node_bev "https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/modules/bird_eye_view.py"
click node_pipeline_config "https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/config.py"
click node_fuzzy_scheduler "https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main_fuzzy.py"
click node_profile_metrics "https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main_profile.py"
click node_visualization "https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/utils/drawing.py"
click node_schedule_log "https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main_fuzzy.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_video_io,node_output_video toneBlue
class node_detector,node_lane_detector,node_depth_estimator,node_bev,node_pipeline_config toneAmber
class node_visualization toneMint
class node_fixed_runner,node_fuzzy_runner,node_profile_runner,node_fuzzy_scheduler,node_profile_metrics,node_schedule_log toneRose
class node_traffic_video toneIndigo
```

## Components

### Video I/O

- [Video processor](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/utils/video.py): `utils/video.py`
- **Output video**

### Perception

- [Object detection](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/modules/object_detection.py): `modules/object_detection.py`
- [Lane detection](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/modules/lane_detection.py): `modules/lane_detection.py`
- [Depth estimation](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/modules/depth_estimation.py): `modules/depth_estimation.py`
- [Bird’s-eye projection](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/modules/bird_eye_view.py): `modules/bird_eye_view.py`
- [Pipeline configuration](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/config.py): `config.py`

### Visualization

- [Overlay and composition](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/utils/drawing.py): `utils/drawing.py`

### Run Modes

- [Fixed pipeline](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main.py): `main.py`
- [Fuzzy pipeline](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main_fuzzy.py): `main_fuzzy.py`
- [Profile pipeline](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main_profile.py): `main_profile.py`
- [Fuzzy scheduler](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main_fuzzy.py): `main_fuzzy.py`
- [Profile metrics](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main_profile.py): `main_profile.py`
- [Schedule CSV log](https://github.com/shadow12546-sketch/adas-perception-fuzzy-scheduling/blob/main/main_fuzzy.py): `main_fuzzy.py`

### Other components

- **Traffic video**

## Connections

- Traffic video → Fixed pipeline: starts with (evidence: `README.md`)
- Traffic video → Fuzzy pipeline: starts with (evidence: `README.md`)
- Traffic video → Profile pipeline: starts with (evidence: `README.md`)
- Fixed pipeline → Video processor: reads frames (evidence: `main.py`)
- Fixed pipeline → Object detection: detects objects (evidence: `main.py`)
- Fixed pipeline → Lane detection: detects lanes (evidence: `main.py`)
- Fixed pipeline → Depth estimation: estimates depth (evidence: `main.py`)
- Fixed pipeline → Bird’s-eye projection: projects view (evidence: `main.py`)
- Fixed pipeline → Overlay and composition: draws and combines (evidence: `main.py`)
- Fixed pipeline → Video processor: writes frames (evidence: `main.py`)
- Fuzzy pipeline → Video processor: reads frames (evidence: `main_fuzzy.py`)
- Fuzzy pipeline → Object detection: detects objects (evidence: `main_fuzzy.py`)
- Fuzzy pipeline → Lane detection: detects lanes (evidence: `main_fuzzy.py`)
- Fuzzy pipeline → Fuzzy scheduler: chooses interval (evidence: `main_fuzzy.py`)
- Fuzzy scheduler → Depth estimation: schedules calls (evidence: `main_fuzzy.py`)
- Fuzzy pipeline → Bird’s-eye projection: projects view (evidence: `main_fuzzy.py`)
- Fuzzy pipeline → Overlay and composition: draws and combines (evidence: `main_fuzzy.py`)
- Fuzzy pipeline → Video processor: writes frames (evidence: `main_fuzzy.py`)
- Fuzzy pipeline → Schedule CSV log: records decisions (evidence: `main_fuzzy.py`)
- Profile pipeline → Video processor: reads frames (evidence: `main_profile.py`)
- Profile pipeline → Object detection: detects objects (evidence: `main_profile.py`)
- Profile pipeline → Lane detection: detects lanes (evidence: `main_profile.py`)
- Profile pipeline → Depth estimation: estimates depth (evidence: `main_profile.py`)
- Profile pipeline → Bird’s-eye projection: projects view (evidence: `main_profile.py`)
- Profile pipeline → Overlay and composition: draws and combines (evidence: `main_profile.py`)
- Profile pipeline → Video processor: writes frames (evidence: `main_profile.py`)
- Profile pipeline → Profile metrics: records timings (evidence: `main_profile.py`)
- Video processor → Output video: writes video
- Object detection → Pipeline configuration: loads settings (evidence: `modules/object_detection.py`)
- Lane detection → Pipeline configuration: loads settings (evidence: `modules/lane_detection.py`)
