Giter Site home page Giter Site logo

espin086 / emotrack Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 3.56 MB

A real-time emotion detection and tracking application using webcam input. Analyze and visualize your emotional trends over time with interactive charts. Dive deep into your daily and weekly emotional landscape!

Python 93.48% Makefile 6.52%

emotrack's Introduction

EmoTrack: Real-Time Emotion Tracking Application

EmoTrack is a real-time emotion tracking application that utilizes facial recognition to capture emotions from a webcam feed. The application is built on Python using Streamlit for the frontend and SQLite for the backend storage. AWS Rekognition is used for emotion detection. This README provides setup instructions and information on how to run the application.

Features

Detects Emotions from Streaming Video

ui_happy

Daily graphs to spot trends in emotional states

ui_new_metrics

How it Works

EmoTrackArchitecture

How It Works

The application follows a streamlined workflow for emotion tracking, utilizing various technologies from Python, OpenCV, Amazon AWS Rekognition, and SQLite:

  1. Application Initialization: Upon launching the application, it starts capturing live video feed from your computer's camera.

  2. Streamlit Framework: Written in Python, the Streamlit framework provides an intuitive user interface that allows you to easily toggle the camera on or off and view real-time emotion metrics.

  3. Video Processing: The video feed is channeled into the Python backend.

  4. Frame Sampling with OpenCV: The Python script employs OpenCV to periodically sample frames from the live video. These frames are compressed to optimize application performance and reduce memory usage.

  5. Facial Analysis via AWS Rekognition: Each sampled frame is sent to Amazon AWS Rekognition's API for facial analysis. If a human face is detected, the emotion with the highest probability score is identified and returned.

  6. Data Storage in SQLite: The recognized emotion, along with the timestamp of the frame, is saved into a SQLite database. This data can later be queried and visualized through the application's dashboard for in-depth emotion tracking and analysis.

Prerequisites

  • Python 3.x
  • AWS account with Rekognition service enabled
  • AWS CLI installed and configured
  • Webcam

Installation

  1. Clone the Repository

    git clone https://github.com/espin086/EmoTrack
    cd EmoTrack
    
  2. Install Required Python Packages

    Create a virtual environment (recommended).

    python3 -m venv venv
    source venv/bin/activate  # On Windows, use `venv\\Scripts\\activate`
    

    Now install the required packages.

    pip3 install -r requirements.txt
    

    Create a requirements.txt file with the following content:

    streamlit
    opencv-python
    pandas
    seaborn
    matplotlib
    boto3
    pytz
    sqlite
    
  3. Configure AWS Rekognition

    Install the AWS CLI and configure it with your AWS credentials.

    aws configure
    

    Follow the prompts to enter your AWS Access Key ID, Secret Access Key, default region, and output format.

  4. Set Up AWS Rekognition

    Make sure you have set up the Rekognition service in the AWS Console.

Usage

  1. Start the Streamlit App

    With your virtual environment activated, run the Streamlit app.

    streamlit run EmoTrack.py
    
  2. Navigate to the App

    Open your web browser and navigate to the address shown in your terminal, usually http://localhost:8501.

  3. Use the App

    • Choose "Webcam Feed" to start capturing your emotions in real-time.
    • Choose "Display Graph" to visualize the tracked emotions over time.

Notes

  1. The emotion tracking will only start when you press the "Start" button and will stop when you press the "Stop" button.
  2. The graph is generated from the data in the SQLite database.

Troubleshooting

If you encounter issues with the webcam feed, make sure your webcam is properly connected and configured.

License

MIT License.

emotrack's People

Contributors

espin086 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

emotrack's Issues

Create CLI for EmoTrack Application using Argparse

Create a Command Line Interface (CLI) for the EmoTrack application to make it easier to use and interact with the functionalities. The CLI should be implemented using the argparse library in Python.

Features to Include:

  1. Options to start the webcam feed and stop the webcam feed.
  2. Display the emotion variation graph based on the data stored in the SQLite database.
  3. Provide a user-friendly interface for users to navigate through the application functionalities.

Additional Details:

  • The CLI should provide clear instructions on how to use each command and navigate through the application.
  • Ensure that the CLI is well-documented and easy to understand for users who are not familiar with the application.
  • Test the CLI thoroughly to ensure all functionalities work as expected.
  • Consider adding additional commands or options to enhance the user experience.

This CLI implementation will improve the usability of the EmoTrack application and make it more accessible to users who prefer using the command line interface.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.