# kavi0562/edu-vision-ai---classroom-human-detection-system architecture

> Architecture diagram of the GitHub repository kavi0562/edu-vision-ai---classroom-human-detection-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kavi0562/edu-vision-ai---classroom-human-detection-system
- Repository: https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system

## Overview

EduVision AI combines classroom person counting and capacity alerts with face-based attendance. The main user workflow enters through the Streamlit app, processes camera or image input for person counts and student recognition, then presents attendance and occupancy status. Separate scripts train and evaluate the person detector, and prepare face-recognition models; group-photo utilities provide an alternate attendance path. The README documents video-stream support and YOLO processing, while sampled code confirms app-level live/image handling and face recognition. Unsampled app sections limit detail on exact input dispatch and persistence wiring.

Main entry points: [`app.py`](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py) (Attendance UI), [`group_photo_attendance.py`](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/group_photo_attendance.py) (Group-photo attendance), [`train.py`](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/train.py) (Train YOLO), [`evaluate.py`](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/evaluate.py) (Detection evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Classroom app"]
  node_streamlit["Attendance UI<br/>[app.py]"]
  node_metrics["Occupancy metrics<br/>[app.py]"]
  node_alerts["Capacity alerts<br/>[app.py]"]
  node_csvlog[("CSV occupancy log<br/>[app.py]")]
  node_summary["Attendance summary<br/>[app.py]"]
end

subgraph group_vision["Person detection"]
  node_person_model["YOLO detector"]
  node_count["Count people<br/>[utils.py]"]
end

subgraph group_identity["Face attendance"]
  node_face_detect["Face detection<br/>[app.py]"]
  node_face_recog["Face recognition<br/>[app.py]"]
  node_attendance["Attendance state<br/>[app.py]"]
  node_group_photo["Group-photo attendance"]
end

subgraph group_ml["Model workflows"]
  node_train_person["Train YOLO<br/>[train.py]"]
  node_dataset["Dataset config<br/>[dataset.yaml]"]
  node_evaluate["Detection evaluation<br/>[evaluate.py]"]
  node_face_train["Train face models"]
end

node_user(("Teacher"))

node_user -->|"starts session"| node_streamlit
node_streamlit -->|"runs detection"| node_person_model
node_streamlit -->|"counts results"| node_count
node_count -->|"returns count"| node_metrics
node_streamlit -->|"renders metrics"| node_metrics
node_streamlit -->|"renders alerts"| node_alerts
node_streamlit -->|"appends log"| node_csvlog
node_streamlit -->|"detects faces"| node_face_detect
node_streamlit -->|"recognizes faces"| node_face_recog
node_streamlit -->|"updates status"| node_attendance
node_streamlit -->|"shows results"| node_summary
node_train_person -->|"uses config"| node_dataset
node_train_person -->|"trains weights"| node_person_model
node_evaluate -->|"validates against"| node_dataset
node_evaluate -->|"evaluates model"| node_person_model
node_face_train -->|"detects training faces"| node_face_detect
node_face_train -->|"trains recognizers"| node_face_recog
node_group_photo -->|"detects faces"| node_face_detect
node_group_photo -->|"reports attendance"| node_attendance

click node_streamlit "https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py"
click node_count "https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/utils.py"
click node_metrics "https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py"
click node_alerts "https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py"
click node_csvlog "https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py"
click node_face_detect "https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py"
click node_face_recog "https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py"
click node_attendance "https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py"
click node_summary "https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py"
click node_train_person "https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/train.py"
click node_dataset "https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/dataset.yaml"
click node_evaluate "https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/evaluate.py"
click node_face_train "https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/train_from_cls_photos.py"
click node_group_photo "https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/group_photo_attendance.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_streamlit,node_metrics,node_alerts,node_csvlog,node_summary toneBlue
class node_person_model,node_count toneAmber
class node_face_detect,node_face_recog,node_attendance,node_group_photo toneMint
class node_train_person,node_dataset,node_evaluate,node_face_train toneRose
class node_user toneIndigo
```

## Components

### Classroom app

- [Attendance UI](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py): `app.py`
- [Occupancy metrics](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py): `app.py`
- [Capacity alerts](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py): `app.py`
- [CSV occupancy log](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py): `app.py`
- [Attendance summary](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py): `app.py`

### Person detection

- **YOLO detector**
- [Count people](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/utils.py): `utils.py`

### Face attendance

- [Face detection](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py): `app.py`
- [Face recognition](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py): `app.py`
- [Attendance state](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/app.py): `app.py`
- [Group-photo attendance](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/group_photo_attendance.py): `group_photo_attendance.py`

### Model workflows

- [Train YOLO](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/train.py): `train.py`
- [Dataset config](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/dataset.yaml): `dataset.yaml`
- [Detection evaluation](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/evaluate.py): `evaluate.py`
- [Train face models](https://github.com/kavi0562/edu-vision-ai---classroom-human-detection-system/blob/main/train_from_cls_photos.py): `train_from_cls_photos.py`

### Other components

- **Teacher**

## Connections

- Teacher → Attendance UI: starts session
- Attendance UI → YOLO detector: runs detection
- Attendance UI → Count people: counts results
- Count people → Occupancy metrics: returns count
- Attendance UI → Occupancy metrics: renders metrics
- Attendance UI → Capacity alerts: renders alerts
- Attendance UI → CSV occupancy log: appends log
- Attendance UI → Face detection: detects faces
- Attendance UI → Face recognition: recognizes faces
- Attendance UI → Attendance state: updates status
- Attendance UI → Attendance summary: shows results
- Train YOLO → Dataset config: uses config
- Train YOLO → YOLO detector: trains weights
- Detection evaluation → Dataset config: validates against
- Detection evaluation → YOLO detector: evaluates model
- Train face models → Face detection: detects training faces
- Train face models → Face recognition: trains recognizers
- Group-photo attendance → Face detection: detects faces
- Group-photo attendance → Attendance state: reports attendance
