# burakulas/detocs architecture

> Architecture diagram of the GitHub repository burakulas/detocs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/burakulas/detocs
- Repository: https://github.com/burakulas/detocs

## Overview

##### Main Components

a) Web Interface Layer:
- User input handling for single/multiple target processing

b) Processing Layer:
- Utils module as a supporting component

c) Model Layer:
- SSD (Single Shot Detector)
- Faster R-CNN
- EfficientDet D1
- To a model selection switch

d) Data Layer:
- Components for:
- Asset storage (labelmap files)
- Training data collection
- TESS EBS external data source

##### Component Relationships

a) Data Flow:
- User input → Web Interface
- Web Interface → Processing Layer
- Processing Layer ↔ Model Layer
- Processing Layer → Data Layer (for training data collection)
- External TESS EBS → Processing Layer

b) Model Selection Flow:
- How the confidence threshold affects model selection
- Model switching capability

##### Important Details to Highlight

- A note about GPU requirement for Faster R-CNN and EfficientDet
- Confidence threshold input affecting model performance
- Training data collection feedback loop
- Period factor calculation process

##### Technical Specifications

- Supported input formats
- Output format [class, x-center, y-center, width, height]
- Supported file types for batch processing

##### Training data collection

Remember to indicate the asynchronous nature of the web interface and the processing pipeline, and show how the system handles multiple concurrent requests.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef webLayer fill:#3498db,stroke:#2980b9,color:white
    classDef processLayer fill:#2ecc71,stroke:#27ae60,color:white
    classDef modelLayer fill:#f1c40f,stroke:#f39c12,color:black
    classDef dataLayer fill:#9b59b6,stroke:#8e44ad,color:white
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Web Interface Layer
    subgraph WebInterface
        UI["Web Interface"]
        Input["User Input Handler"]
    end
    class UI,Input webLayer

    %% Processing Layer
    subgraph Processing
        MainProc["Main Processor"]
        Utils["Utils Module"]
        Threshold["Confidence Threshold"]
    end
    class MainProc,Utils,Threshold processLayer

    %% Model Layer
    subgraph Models
        ModelSelect{"Model Selector"}
        SSD["SSD Model"]
        FRCNN["Faster R-CNN"]
        EffDet["EfficientDet D1"]
    end
    class ModelSelect,SSD,FRCNN,EffDet modelLayer

    %% Data Layer
    subgraph Data
        Assets[("Asset Storage")]
        LabelMaps[("Label Maps")]
        TrainingData[("Training Data")]
    end
    class Assets,LabelMaps,TrainingData dataLayer

    %% External Systems
    TESS["TESS EBS Data Source"]:::external

    %% Relationships
    UI --> Input
    Input --> MainProc
    MainProc <--> Utils
    MainProc --> ModelSelect
    ModelSelect --> SSD
    ModelSelect --> FRCNN
    ModelSelect --> EffDet
    Threshold --> ModelSelect
    MainProc --> TrainingData
    TESS --> MainProc
    Assets --> MainProc
    LabelMaps --> ModelSelect

    %% Click Events
    click UI "https://github.com/burakulas/detocs/blob/main/templates/index.html"
    click MainProc "https://github.com/burakulas/detocs/blob/main/detocs.py"
    click Utils "https://github.com/burakulas/detocs/blob/main/utils/utils.py"
    click SSD "https://github.com/burakulas/detocs/blob/main/models/ssd/SSD_detect.tflite"
    click FRCNN "https://github.com/burakulas/detocs/tree/main/models/frcnn"
    click EffDet "https://github.com/burakulas/detocs/tree/main/models/effdet"
    click Assets "https://github.com/burakulas/detocs/tree/main/assets/"
    click LabelMaps "https://github.com/burakulas/detocs/blob/main/assets/labelmap.pbtxt"
    click TESS "https://github.com/burakulas/detocs/blob/main/assets/tess_ebs_data.csv"

    %% Legend
    subgraph Legend
        L1["Web Component"]:::webLayer
        L2["Processing Component"]:::processLayer
        L3["Model Component"]:::modelLayer
        L4["Data Storage"]:::dataLayer
        L5["External System"]:::external
    end
```
