Skip to content

sudo-paras-shah/real-time-micro-expression-recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

real-time-micro-expression-recognition

This project serves as a proof of concept of the use of micro-expression recognition in the field of mental health. It uses normal "macro-expressions" as well as "micro-expressions" to get the true mood of a user based on their facial expressions.

What are micro-expressions?

Micro-expression (ME) is an involuntary, fleeting, and subtle facial expression. It may occur in high-stake situations when people attempt to conceal or suppress their true feelings. Therefore, MEs can provide essential clues to people’s true feelings and have plenty of potential applications, such as national security, clinical diagnosis, and interrogations. In recent years, ME analysis has gained much attention in various fields due to its practical importance, especially automatic ME analysis in computer vision as MEs are difficult to process by naked eyes.

Facial Micro-Expressions: An Overview (2023)

Requirements

Note: This was tested in Fedora Linux 41/42 using X11 NVIDIA desktop environment. I have no idea about other Linux distros, Windows or Mac but you can try.

  1. Setup an anaconda environment using conda create -n <env-name> python=3.12.9
  2. Activate the environment using conda activate <env-name>
  3. Install the requirements using pip install -r reqiurements.txt
  4. Download pre-trained models from the given link and put them in the model_data folder:
    https://huggingface.co/sudo-paras-shah/micro-expression-casme2
    https://github.com/tbx1b/emotion-recognizer

How to run the code

  1. Just run the app.py code using streamlit run app.py
  2. App is now running on localhost using Streamlit UI

Optional: Setup ngrok to run on the internet

  1. Download and setup ngrok from https://dashboard.ngrok.com/get-started/setup/linux (This link is for Linux. Use the specific executable or setup code for the operating system that you are using)
  2. Assuming streamlit is running on port 8501, you can just run ngrok http 8501
  3. Open the link provided in the terminal and you are hosting this streamlit app on the internet

Some other details

  • Micro-expression recognition model was trained on the CASME-II dataset for 100 epochs using this repository: MicroExpressionRecognition
  • The dataset is private and requires signing of a license agreement which is available here: http://casme.psych.ac.cn/casme/
  • This repository: https://github.com/tbx1b/emotion-recognizer does not belong to me and I am not claiming credit over the work done here. I quickly wanted a pre-trained facial expression recognition model so that's why I used it. You can use any facial expression recognition model that you want.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages