Skip to content

b-bohdan-st/affectflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AffectFlow

Real-time Fatigue and Attention Analysis using Computer Vision

A desktop application that analyzes user fatigue and attention level in real time using webcam video and facial landmark detection.


About The Project

AffectFlow is a desktop application designed to monitor fatigue and attention levels using computer vision techniques.

The system analyzes facial features in real time and evaluates:

  • Eye blinking patterns (EAR)
  • Yawning detection (MAR)
  • Gaze direction
  • Head position

All processing is performed locally — no cloud services required.


Architecture

Electron Frontend

  • Webcam capture
  • User interface
  • Charts visualization
  • Communication with backend

Python Analysis Module

  • MediaPipe FaceMesh landmark detection
  • EAR calculation (Eye Aspect Ratio)
  • MAR calculation (Mouth Aspect Ratio)
  • Fatigue scoring algorithm
  • Attention estimation

Data flow:
Camera → Electron (JS) → Python analysis → Metrics → UI update


Built With

  • Electron
  • HTML / CSS
  • JavaScript
  • Chart.js
  • Python
  • MediaPipe
  • OpenCV

Features

  • Real-time fatigue monitoring
  • Attention level estimation
  • Local processing (privacy friendly)
  • Blink detection algorithm
  • Yawn detection
  • Automatic break recommendation
  • Interactive statistics visualization
  • Multi-page desktop interface

Screenshots

Home (Live Analysis)

Home

Statistics (Charts)

Statistics


Getting Started

Requirements

Make sure you have installed:

  • Node.js (LTS version recommended)
  • Python 3.10+ (recommended)

Installation

  1. Clone the repository:
git clone https://github.com/b-bohdan-st/affectflow.git
cd affectflow
  1. Install Node.js dependencies:
npm install
  1. Install Python dependencies:
pip install mediapipe==0.10.21 opencv-python numpy pygame pyqt6
  1. Start the application:
npm start

Usage

  1. Launch the application
  2. Press Start analysis
  3. Real-time monitoring begins
  4. View statistics in the Statistics tab

Roadmap

  • User profiles
  • Custom AI model training
  • Model sharing between users
  • Extended analytics system
  • Mobile companion

Practical Applications

  • Education and learning focus monitoring
  • Workplace productivity
  • Digital wellbeing
  • Ergonomic analysis

Author

Bohdan Bondar


License

Educational project.

About

Real-time desktop app for fatigue and attention monitoring using computer vision

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors