# nehakirannayak/navigation-assist architecture

> Architecture diagram of the GitHub repository nehakirannayak/navigation-assist, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nehakirannayak/navigation-assist
- Repository: https://github.com/nehakirannayak/navigation-assist

## Overview

##### Main Components
- Web Frontend: Represent the UI built from HTML templates (object_index.html, object_index2.html, face_index.html, face_index2.html) for user interactions.
- Flask Backend: The main server logic is in app.py, which acts as the entry point and routes requests to the appropriate functionalities.
- Object Detection Module: Represented by object_camera.py, which likely contains the VideoCamera class handling real-time object detection.
- Face Recognition Module: Represented by facecam.py, which contains the Facecamera class for live face identification and recognition.
- Data Files: Include the encod_list.data and face_list.data files as part of the persistence layer that store learned models or encodings.
- External Libraries/Technologies: Indicate dependencies (for example, OpenCV for computer vision, Flask for the web framework) as noted in requirements.txt.

##### Component Relationships and Interactions
- The Client (Web Browser) accesses the system via the user-friendly web interface (displayed through the HTML templates).
- Requests from the client are handled by app.py (Flask backend), which then routes them to the appropriate service modules.
- When object detection is activated, app.py interfaces with the object_camera module to retrieve a real-time video feed overlayed with detection results.
- Similarly, for face recognition functionality, app.py interacts with the facecam module.
- Both modules likely utilize the data files (encod_list.data, face_list.data) for accessing or updating stored recognition data.

##### Architectural Patterns and Design Principles
- Separation of Concerns: The project clearly splits responsibilities, with separate modules handling frontend, object detection, and face recognition.
- Modular Design: By isolating functionality into distinct files (app.py, object_camera.py, facecam.py), you enable easier maintenance and future enhancements (such as the planned mobile application).
- Real-time Data Processing: The design supports live video streaming integrated with computer vision algorithms.
- Extensibility: The README hints at future development for additional assistive technologies, so the design should leave clear integration points.

- Next, represent the Flask backend as the central hub managing routes and processing.
- Branch out to two parallel modules (one for object detection and one for face recognition) which the Flask app calls based on the user’s actions.
- Finally, indicate how these modules interact with local data files (for storing or retrieving recognized features).
- External dependencies or libraries (like OpenCV) used in these modules.
- Marking the "Future Development" layer where mobile applications or additional assistive technologies might interact with this foundation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        Client["Web Client"]:::client
        FE["Web Frontend (HTML Templates)"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        BE["Flask Backend (app.py)"]:::backend
    end

    %% Processing Modules
    subgraph "Processing Modules"
        OD["Object Detection (object_camera.py)"]:::module
        FR["Face Recognition (facecam.py)"]:::module
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        DS1["Encoding Data (encod_list.data)"]:::data
        DS2["Face Data (face_list.data)"]:::data
    end

    %% External Services
    subgraph "External Services"
        ED["External Dependencies (requirements.txt)"]:::external
    end

    %% Future Development (Optional)
    FD["Future Assistive Technologies"]:::future

    %% Connections
    Client -->|"HTTP_Request"| FE
    FE -->|"Render"| BE
    BE -->|"Routes_ObjectDetection"| OD
    BE -->|"Routes_FaceRecognition"| FR
    OD -->|"Access_Data"| DS1
    FR -->|"Access_Data"| DS2
    BE -->|"Uses"| ED
    OD -->|"Uses"| ED
    FR -->|"Uses"| ED
    BE -->|"Future_Extension"| FD

    %% Click Events
    click FE "https://github.com/nehakirannayak/navigation-assist/tree/main/templates"
    click BE "https://github.com/nehakirannayak/navigation-assist/blob/main/app.py"
    click OD "https://github.com/nehakirannayak/navigation-assist/blob/main/object_camera.py"
    click FR "https://github.com/nehakirannayak/navigation-assist/blob/main/facecam.py"
    click DS1 "https://github.com/nehakirannayak/navigation-assist/blob/main/encod_list.data"
    click DS2 "https://github.com/nehakirannayak/navigation-assist/blob/main/face_list.data"
    click ED "https://github.com/nehakirannayak/navigation-assist/blob/main/requirements.txt"

    %% Styles
    classDef client fill:#FFDDCC,stroke:#FF6600,stroke-width:2px;
    classDef frontend fill:#CCFFCC,stroke:#339933,stroke-width:2px;
    classDef backend fill:#CCCCFF,stroke:#333399,stroke-width:2px;
    classDef module fill:#FFFFCC,stroke:#CCCC00,stroke-width:2px;
    classDef data fill:#F0F0F0,stroke:#999999,stroke-width:2px;
    classDef external fill:#FFC0CB,stroke:#FF69B4,stroke-width:2px;
    classDef future fill:#D3D3D3,stroke:#696969,stroke-width:2px;
```
