# nandakumar005/wild-animal-intrusion-detection-using-yolov8 architecture

> Architecture diagram of the GitHub repository nandakumar005/wild-animal-intrusion-detection-using-yolov8, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8
- Repository: https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8

## Overview

This Flask wildlife-monitoring application starts from a browser-selected video source, analyzes frames with a configured YOLO model, displays a live annotated feed, and records detections for review; detections can also trigger email alerts. The main runtime is concentrated in app.py, with config.py providing model, storage, and alert settings. README documents CCTV and uploaded-video support and archived media; the sampled implementation shows image saving, not clip generation. The graph reflects the inspected app.py and config.py plus documented capabilities.

Main entry points: [`app.py`](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/app.py) (Flask routes), [`templates/index.html`](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/templates/index.html) (Browser interface), [`config.py`](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/config.py) (Runtime configuration), [`templates/detections.html`](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/templates/detections.html) (Detection history page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_browser["Browser interface<br/>[index.html]"]
  node_detections_page["Detection history page<br/>[detections.html]"]
  node_settings_page["Settings page<br/>[settings.html]"]
  node_flask_app["Flask routes<br/>[app.py]"]
end

subgraph group_runtime["Detection runtime"]
  node_source_devices["Camera or video"]
  node_frame_stream["Frame stream<br/>[app.py]"]
  node_wildlife_detector["Wildlife detector<br/>[app.py]"]
  node_yolo_model["YOLO weights<br/>[best.pt]"]
  node_configuration["Runtime configuration<br/>[config.py]"]
end

subgraph group_records["Alerts and records"]
  node_detection_history[("Detection history<br/>[app.py]")]
  node_saved_images[("Saved detection images<br/>[app.py]")]
  node_email_alerts["Email alerts<br/>[app.py]"]
end

node_operator(("Operator"))
node_smtp["SMTP service"]

node_operator -->|"uses"| node_browser
node_browser -->|"submits requests"| node_flask_app
node_flask_app -->|"renders dashboard"| node_browser
node_flask_app -->|"renders history"| node_detections_page
node_flask_app -->|"renders settings"| node_settings_page
node_operator -->|"selects source"| node_source_devices
node_flask_app -->|"opens source"| node_source_devices
node_source_devices -->|"provides frames"| node_frame_stream
node_frame_stream -->|"processes frames"| node_wildlife_detector
node_wildlife_detector -->|"loads weights"| node_yolo_model
node_flask_app -->|"imports settings"| node_configuration
node_frame_stream -->|"updates detections"| node_detection_history
node_flask_app -->|"reads detections"| node_detection_history
node_frame_stream -->|"writes images"| node_saved_images
node_frame_stream -->|"dispatches alert"| node_email_alerts
node_email_alerts -->|"sends email"| node_smtp
node_flask_app -->|"updates threshold"| node_configuration

click node_browser "https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/templates/index.html"
click node_detections_page "https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/templates/detections.html"
click node_settings_page "https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/templates/settings.html"
click node_flask_app "https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/app.py"
click node_frame_stream "https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/app.py"
click node_wildlife_detector "https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/app.py"
click node_yolo_model "https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/best.pt"
click node_configuration "https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/config.py"
click node_detection_history "https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/app.py"
click node_saved_images "https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/app.py"
click node_email_alerts "https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/app.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_browser,node_detections_page,node_settings_page,node_flask_app toneBlue
class node_source_devices,node_frame_stream,node_wildlife_detector,node_yolo_model,node_configuration toneAmber
class node_detection_history,node_saved_images,node_email_alerts toneMint
class node_operator,node_smtp toneIndigo
```

## Components

### Web interface

- [Browser interface](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/templates/index.html): `templates/index.html`
- [Detection history page](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/templates/detections.html): `templates/detections.html`
- [Settings page](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/templates/settings.html): `templates/settings.html`
- [Flask routes](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/app.py): `app.py`

### Detection runtime

- **Camera or video**
- [Frame stream](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/app.py): `app.py`
- [Wildlife detector](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/app.py): `app.py`
- [YOLO weights](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/best.pt): `best.pt`
- [Runtime configuration](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/config.py): `config.py`

### Alerts and records

- [Detection history](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/app.py): `app.py`
- [Saved detection images](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/app.py): `app.py`
- [Email alerts](https://github.com/nandakumar005/wild-animal-intrusion-detection-using-yolov8/blob/main/app.py): `app.py`

### Other components

- **Operator**
- **SMTP service**

## Connections

- Operator → Browser interface: uses (evidence: `README.md`)
- Browser interface → Flask routes: submits requests (evidence: `app.py`)
- Flask routes → Browser interface: renders dashboard (evidence: `app.py`)
- Flask routes → Detection history page: renders history (evidence: `app.py`)
- Flask routes → Settings page: renders settings (evidence: `app.py`)
- Operator → Camera or video: selects source (evidence: `README.md`)
- Flask routes → Camera or video: opens source (evidence: `app.py`)
- Camera or video → Frame stream: provides frames (evidence: `app.py`)
- Frame stream → Wildlife detector: processes frames (evidence: `app.py`)
- Wildlife detector → YOLO weights: loads weights (evidence: `app.py`)
- Flask routes → Runtime configuration: imports settings (evidence: `app.py`)
- Frame stream → Detection history: updates detections (evidence: `app.py`)
- Flask routes → Detection history: reads detections (evidence: `app.py`)
- Frame stream → Saved detection images: writes images (evidence: `app.py`)
- Frame stream → Email alerts: dispatches alert (evidence: `app.py`)
- Email alerts → SMTP service: sends email (evidence: `app.py`)
- Flask routes → Runtime configuration: updates threshold (evidence: `app.py`)
