# jasminaaa20/human-action-recognition-in-the-dark architecture

> Architecture diagram of the GitHub repository jasminaaa20/human-action-recognition-in-the-dark, 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/jasminaaa20/human-action-recognition-in-the-dark
- Repository: https://github.com/jasminaaa20/human-action-recognition-in-the-dark

## Overview

##### Main Components
- Data Preprocessing Pipeline
- Modules in the “keypoint_dataset_creation” directory (e.g., frame_extractor.py, preprocessing.py, keypoint_detector.py, etc.). These files constitute the pipeline to extract frames, apply histogram equalization, and detect key-points.
- How frames are extracted from videos (the provided .mp4 file) and then processed for further analysis.

- Model Training and Inference
- LRCN model, whose architecture is briefly mentioned in the README. This component handles both the training phase (using categorical cross-entropy loss and Adam optimizer) and inference. Note the presence of model files (.h5 and .pkl) located in the web_interface/API/models directory.
- Training steps (compilation, loss, accuracy metrics) and evaluation (e.g., confusion matrix generation).

- Web Interface (Full-Stack Application Components)
- Backend API: Represent the “web_interface/API” folder which contains server-side Python code including processing scripts (e.g., clahe_processor.py, face_recognition_class.py, pre_processing.py) and the main application script (app.py). This API acts as the bridge between the frontend and the machine learning backend.
- Frontend: Show the “web_interface/frontend” directory that includes Next.js-based React components (e.g., Face.jsx, Faces.jsx, VideoPlayer.jsx, WebCam.jsx). This provides a user interface for interacting with the backend and viewing results or live data.

- Notebook Analysis and Prototyping

##### Relationships and Interactions
- Data Flow: Begin with video input provided by raw video files (like drink-1-13_1uonzte1.mp4) → Frame Extraction → Preprocessing (including histogram equalization) → Keypoint Detection → Prepared data fed into the LRCN training/inference module.
- Model Artifacts: Represent storage/use of model files (e.g., .h5, .pkl) used for inference during API calls.

##### Architectural Patterns and Design Principles
- Modularity: Emphasize separation between data processing, model training/inference, and presentation layers.
- Full-stack Approach: A clear demarcation is present between the backend (machine learning logic and API endpoints) and the frontend (user interface).
- Pipeline Architecture: The preprocessing pipeline illustrates sequential data handling – from frame extraction and keypoint detection to feeding into the LRCN network.

##### Technologies, Frameworks, and Libraries
- Python modules for preprocessing and model training (Keras/TensorFlow for LRCN, YOLOv8-pose for key-point detection).
- Frontend tools: Next.js, React, Tailwind CSS indicated by files in the “web_interface/frontend” folder.
- API development framework in Python (Flask or FastAPI may be implicitly used given the structure in the API folder).

## Diagram (Mermaid)

```mermaid
graph TD
    A["Video Input (.mp4)"]
    PP["Data Preprocessing Pipeline"]
    B["Frame Extraction"]
    C["Histogram Equalization"]
    D["Key-point Detection (YOLOv8-pose)"]
    E["Preprocessed Data"]
    F["LRCN Model Training & Inference"]
    G["Model Artifacts (.h5, .pkl)"]
    H["API Backend"]
    I["Web Interface Frontend (Next.js)"]
    J["Notebook Prototyping"]

    A --> PP
    PP --> B
    B --> C
    C --> D
    D --> E
    E --> F
    F --> G
    G --> H
    H <--> I
    J -.-> F

    click PP "https://github.com/jasminaaa20/human-action-recognition-in-the-dark/tree/main/keypoint_dataset_creation/"
    click F "https://github.com/jasminaaa20/human-action-recognition-in-the-dark/tree/main/web_interface/API/models/"
    click H "https://github.com/jasminaaa20/human-action-recognition-in-the-dark/tree/main/web_interface/API/"
    click I "https://github.com/jasminaaa20/human-action-recognition-in-the-dark/tree/main/web_interface/frontend/"
    click J "https://github.com/jasminaaa20/human-action-recognition-in-the-dark/tree/main/notebooks/"

    class A video;
    class PP,B,C,D,E preproc;
    class F,G ml;
    class H api;
    class I frontend;
    class J notebook;

    classDef video fill:#f9d6d5,stroke:#d24d57,stroke-width:2px;
    classDef preproc fill:#b3e5fc,stroke:#0288d1,stroke-width:2px;
    classDef ml fill:#fff9c4,stroke:#fbc02d,stroke-width:2px;
    classDef api fill:#ffe0b2,stroke:#fb8c00,stroke-width:2px;
    classDef frontend fill:#dcedc8,stroke:#7cb342,stroke-width:2px;
    classDef notebook fill:#fce4ec,stroke:#d81b60,stroke-width:2px;
```
