# alok059/human-det-face-recog-lora architecture

> Architecture diagram of the GitHub repository alok059/human-det-face-recog-lora, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alok059/human-det-face-recog-lora
- Repository: https://github.com/alok059/human-det-face-recog-lora

## Overview

##### Project type and purpose
- This is an IoT-enabled, border-monitoring prototype using edge-AI and LoRaWAN for long-range, low-power wireless alerts.
- The core functionality: capture images at the border, detect humans and faces with YOLOv8 and a face-recognition library on a Raspberry Pi, then send alerts over LoRa from a transmitter node to a receiver node (Arduino sketches).

##### File structure
- Top level:
– DemoVideo.mp4: demo recording
– Faces/: face database for recognition
– yolov8n.pt: pretrained YOLOv8 Nano model
– main.py, newest.py: Python scripts driving camera capture, YOLO inference, face matching, and LoRa transmission via serial
- Receiver/rec_sak.ino: Arduino code for LoRa receiver and post-processing (e.g., trigger alarm, LEDs)
- Transmitter/transmitter2.ino and sketch_nov06a/: Arduino sketches—likely early and revised versions for the LoRa transmitter node, sensor or serial interface to the Pi

##### README for additional insights
- Confirms tools: Python, YOLOv8, face-recognition library, Raspberry Pi, Arduino, LoRa modules
- No explicit database or cloud back-end—storage is local, processing is edge-only

##### Detail-level note
- Don’t split hairs over versions of Arduino sketches—group them as “Transmitter firmware.”
- Edge-AI steps: image acquisition → detection → recognition → decision → communication.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Edge AI Node"
        Pi["Raspberry Pi"]:::hardware
        Cam["Camera Module"]:::hardware
        Capture["main.py / newest.py"]:::software
        YOLO["yolov8n.pt<br/>YOLOv8 Inference"]:::software
        Faces["Faces/ Face DB"]:::software
        Decision["Decision Module"]:::software
        Pi --> Cam
        Cam -->|"image stream"| Capture
        Capture -->|"frame buffer"| YOLO
        YOLO -->|"detections"| Decision
        Faces --> Decision
        Decision -->|"alert packet"| PiOut[/"Serial Out"/]:::hardware
    end

    subgraph "LoRa Transmitter"
        TXArd["Arduino Transmitter + LoRa Shield"]:::hardware
        PiOut -->|"UART/USB"| TXArd
    end

    LoRaLink((LoRa Wireless Link)):::link

    TXArd -->|"LoRa TX"| LoRaLink

    subgraph "LoRa Receiver"
        RXArd["Arduino Receiver + LoRa Shield"]:::hardware
        Actuator["Buzzer/LED"]:::actuator
        LoRaLink -->|"LoRa RX"| RXArd
        RXArd -->|"trigger"| Actuator
    end

    subgraph "Monitoring Station (Optional)"
        Monitor["PC/Server"]:::hardware
        RXArd -->|"status/logs"| Monitor
    end

    subgraph "Legend"
        HW["Hardware"]:::hardware
        SW["Software"]:::software
        LK["Wireless Link"]:::link
        AC["Actuator"]:::actuator
    end

    click Capture "https://github.com/alok059/human-det-face-recog-lora/blob/main/main.py"
    click Capture "https://github.com/alok059/human-det-face-recog-lora/blob/main/newest.py"
    click Faces "https://github.com/alok059/human-det-face-recog-lora/tree/main/Faces/"
    click YOLO "https://github.com/alok059/human-det-face-recog-lora/blob/main/yolov8n.pt"
    click TXArd "https://github.com/alok059/human-det-face-recog-lora/blob/main/Transmitter/transmitter2.ino"
    click TXArd "https://github.com/alok059/human-det-face-recog-lora/blob/main/sketch_nov06a/sketch_nov06a.ino"
    click RXArd "https://github.com/alok059/human-det-face-recog-lora/blob/main/Receiver/rec_sak.ino"
    click Monitor "https://github.com/alok059/human-det-face-recog-lora/blob/main/README.md"
    click Monitor "https://github.com/alok059/human-det-face-recog-lora/blob/main/DemoVideo.mp4"

    classDef hardware fill:#f9f,stroke:#333,stroke-width:1px
    classDef software fill:#9cf,stroke:#333,stroke-width:1px
    classDef link stroke:#36f,stroke-dasharray:5 5
    classDef actuator fill:#fc9,stroke:#333,stroke-width:1px
```
