Skip to content

clatonhendricks/MoodPulse

Repository files navigation

MoodPulse

A personal emotion tracking application that captures your face and logs your emotional state over time. Like checking your emotional pulse - the app runs automatically every 2 hours via Windows Task Scheduler and includes a web dashboard to visualize your emotional patterns.

🎯 Features

  • Automated Face Capture - Launches every 2 hours via Windows Task Scheduler
  • Face Detection - Uses OpenCV's Haar Cascade classifier to detect and crop only your face
  • Emotion Selection - Choose from 12 emotions: Neutral, Stressed, Happy, Sad, Angry, Depressed, Fear, Disgust, Excited, Nervous, Surprised, Worried
  • Data Logging - Saves timestamped face images and emotions to CSV
  • Web Dashboard - Flask-based dashboard with interactive charts to visualize emotional trends

📁 Project Structure

Face_emotion/
├── camera-emotion-logger.py    # Main application for capturing face and logging emotions
├── emotion_log.csv             # CSV file storing all emotion entries
├── images/                     # Stored face images with timestamps
├── RunApp.bat                  # Batch file to run the web dashboard
├── Captureface-ScheduleTask.xml # Windows Task Scheduler configuration
└── Web_app/
    └── emotion_dashboard/
        ├── app.py              # Flask web server
        ├── templates/          # HTML templates for dashboard
        └── static/             # Static assets (CSS, JS)

🛠️ Requirements

Python Dependencies

  • opencv-python
  • tkinter (included with Python)
  • Pillow
  • numpy
  • flask
  • pandas
  • plotly

Install dependencies:

pip install -r requirements.txt

🚀 Usage

Face Capture Application

Run manually or let Task Scheduler trigger it:

python camera-emotion-logger.py
  1. A camera preview window appears with face detection overlay
  2. Click Capture when your face is detected (green rectangle)
  3. Select your current emotion from the dropdown
  4. Click Save to log the entry, Retake to try again, or Cancel to exit

Web Dashboard

Start the dashboard to view your emotion analytics:

python Web_app/emotion_dashboard/app.py

Then open http://localhost:5000 in your browser.

The dashboard displays:

  • Emotion distribution pie/bar charts
  • Daily patterns by hour
  • Weekly trends by day of week
  • Monthly evolution
  • Summary statistics

⏰ Task Scheduler Setup

The included MoodPulse-ScheduleTask.xml can be imported into Windows Task Scheduler to run the face capture app every 2 hours automatically.

  1. Open Task Scheduler
  2. Click Import Task...
  3. Select MoodPulse-ScheduleTask.xml
  4. Important: Edit the task and update these paths to match your system:
    • Program/script: Path to your python.exe
    • Arguments: Path to camera-emotion-logger.py
    • Start in: Path to the project folder
  5. Enable the task

📊 Data Format

The emotion_log.csv stores entries with the following columns:

Column Description
DateTime Timestamp of capture (YYYY-MM-DD HH:MM:SS)
Image Name Filename of saved face image
Image Path Full path to image file
Emotion Selected emotion

📸 How It Works

  1. The app opens your webcam and displays a live preview
  2. Face detection identifies your face and draws a bounding box
  3. When you capture, only the detected face (with 20% padding) is cropped and saved
  4. You select your emotion and the data is logged to CSV
  5. The web dashboard reads the CSV and generates interactive visualizations

📝 License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

This means you can use, modify, and distribute this software, but any derivative works must also be open source under the same license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors