Smile Detection Game is a cutting-edge application that leverages machine learning and real-time video to count smiles from two individuals independently. Powered by the face-api.js library, the application employs facial expression analysis to determine when a person is smiling and updates the smile counter correspondingly. The game lasts for 10 seconds and the winner is the person who smiles the most during that time.
You can try out the application here. Simply allow webcam access and start smiling!
To get the application running locally on your machine, follow these steps:
- Clone the repository:
git clone https://github.com/seeknndestroy/smile-detection.git
- Navigate to the directory:
cd smile-detection
- Open the
index.html
file: You can do this in your preferred browser.
Please note that the application requires a webcam to function correctly.
The usage of the application is straightforward. After opening the index.html
file in your browser:
- Allow the application to access your webcam.
- You will see your video feed on the screen along with two smile counters (one for each person).
- Click the "Start" button to start the game.
- Smile as much as you can for 10 seconds.
- After 10 seconds, a pop-up will appear displaying the winner.
- Click the "Play Again" button to play again.
- If the game has already started, users can only press the "Restart" button to restart the game.
- If the game has already ended, users can only press the "Play Again" button to play again.
Here's a diagram of how the application works:
The smile detection process involves the following steps:
- The process starts with the video feed from the webcam.
- The face detection model identifies the location and size of faces in the video feed.
- The facial expression recognition model identifies the expressions of the detected faces.
- The smile counting algorithm counts the number of times a 'happy' expression (or smile) is detected for each individual.
- The smile counter is updated correspondingly.
Contributions are welcome and greatly appreciated! For detailed instructions on how to contribute, please refer to the CONTRIBUTING.md
file in the repository.
This project is licensed under the MIT license. For more information, please refer to the LICENSE
file in the repository.
As an enthusiast of technology and its potential to bring positivity, creating a tool that encourages smiles was an exciting journey. I believe this project is a testament to the potential of combining simple user interfaces with powerful machine learning libraries to create an engaging user experience. Thank you for checking out my project!