Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

AI-powered real-time emotion detection desktop app using DeepFace. Track emotions via webcam with privacy-focused local processing, analytics dashboard, and CSV export.

License

Notifications You must be signed in to change notification settings

DeepPythonist/EmotionTracker

Repository files navigation

Emotion Tracker

A professional Python desktop application for real-time facial emotion detection using DeepFace. The application analyzes user emotions via webcam and stores data as time-series CSV files with comprehensive analytics.

πŸŽ₯ Demo Video

Emotion Tracker Demo

Watch the demo GIF above

Features

  • Real-time Emotion Detection: Uses DeepFace for accurate emotion recognition
  • Interactive GUI: Three-tab interface (Control, Monitor, Analytics)
  • Performance Optimized: Processes every 3rd frame to reduce CPU load
  • Data Storage: Automatically saves daily CSV files with timestamps
  • Visual Analytics: Pie charts and statistics for emotion analysis
  • Privacy-Focused: All data stored locally, no internet transmission

Requirements

  • Python 3.11+ (tested with Python 3.11.1)
  • Webcam access
  • Internet connection (for initial DeepFace model download)
  • macOS 11.0+ / Windows 10+ / Ubuntu 18.04+

Installation

  1. Clone this repository:

    git clone https://github.com/DeepPythonist/EmotionTracker.git
    cd EmotionTracker
  2. Create virtual environment:

    python -m venv venv
    source venv/bin/activate # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Run the application:

    python main.py

Usage

Control Tab

  • Click START to begin emotion detection
  • Click STOP to stop recording
  • Monitor status and frame count

Monitor Tab

  • View current detected emotion in large text
  • See confidence level with progress bar
  • Track session statistics and top emotions

Analytics Tab

  • Select date from dropdown to view historical data
  • View emotion distribution pie chart (if matplotlib available)
  • Review summary statistics
  • Monitor current session emotions

Data Storage

  • CSV files are automatically created in the data/ directory
  • File naming format: emotions_YYYY-MM-DD.csv
  • Columns: timestamp,emotion,confidence
  • Data is appended continuously during recording sessions

Performance Optimization

The application implements several optimization techniques:

  • Processes every 3rd frame (not every frame)
  • Uses enforce_detection=False for better edge case handling
  • Implements frame skipping when processing takes >100ms
  • Resizes frames to 640x480 before processing
  • Caches DeepFace model on first load
  • Uses threading to separate UI from processing

Error Handling

  • Camera not found: Shows error dialog, disables START button
  • DeepFace import error: Shows installation instructions
  • No face detected: Skips frame silently
  • Low confidence (<0.5): Marks as "uncertain"

Project Structure

EmoNet/
β”œβ”€β”€ main.py # Main application
β”œβ”€β”€ requirements.txt # Dependencies
β”œβ”€β”€ README.txt # Installation guide
β”œβ”€β”€ PRIVACY.txt # Privacy policy
β”œβ”€β”€ LICENSE.txt # MIT License
β”œβ”€β”€ core/ # Core modules
β”‚ β”œβ”€β”€ camera_handler.py
β”‚ β”œβ”€β”€ emotion_detector.py
β”‚ └── data_manager.py
β”œβ”€β”€ ui/ # UI components
β”‚ β”œβ”€β”€ main_window.py
β”‚ β”œβ”€β”€ monitor_tab.py
β”‚ └── analytics_tab.py
β”œβ”€β”€ utils/ # Utility modules
β”‚ └── config.py
└── data/ # Data storage folder

Technical Details

  • CPU Usage: <15% on modern i5 processors
  • RAM Usage: <500MB
  • Detection Latency: <2 seconds per processed frame
  • UI Responsiveness: No freezing during processing

Dependencies

  • deepface==0.0.79
  • opencv-python==4.8.1.78
  • pandas>=2.0.0,<2.2.0
  • matplotlib>=3.7.0,<3.9.0
  • seaborn>=0.12.0,<0.14.0
  • pillow>=9.0.0,<11.0.0
  • tensorflow>=2.13.0,<2.16.0
  • numpy>=1.21.0,<2.0.0

Support

If you have any issues:

License

MIT License - See LICENSE.txt for details.

This project is provided for educational and research purposes.

About

AI-powered real-time emotion detection desktop app using DeepFace. Track emotions via webcam with privacy-focused local processing, analytics dashboard, and CSV export.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /