Project Level: Real-World
This project is designed for learners who know Python fundamentals and are learning to build real-world programs.
Project Description
Today, we will build a program that starts the camera on your computer and detects your mood based on your facial expressions.
For this program, we are using TensorFlow and OpenCV as the two main libraries. For the mood detection model we are using the one which you can download in the link below.
It detects angry, disgusted, fear, happy, neutral, sad, and surprised faces.
Prerequisites
Required Libraries: random, os, numpy, OpenCV, TensorFlow, mediapipe
pip install numpy opencv-python tensorflow mediapipe
Required Files: No files are required.
IDE: Use any IDE.
Danger Zone
The solution code is hidden behind the button below. Click to reveal it.
Happy Coding!
Daily Python Projects Team
Hi Ardit,
1. Can you link to the trained mood detection model supposedly here: "As a mood detection model, we are using this here in the link." There's not a link.
2. Can you help with the pygame play_music(mood) statement that's in the detect_mood function? It's undefined as a variable. There doesn't look to be a pygame play_music method. Is it your function?
Thank you,
Ryan