This is a Python Project featuring Smile Detection Scripts for both Images & Videos made using Python. The Smile Detection is achieved through the Haar Cascaade Pretrained Face Data Model & Pretrained Smile Model loaded using OpenCV Python.
Install the following Python libraries in your Virtual Environment using PIP.
Note: The library names are CASE-SENSITIVE for PIP installations below. Make sure your type them correctly.
Install OpenCV for Python
pip install opencv-python
Download a copy of this repository onto your local machine and extract it into a suitable folder.
- Create a Virtual Environment in that folder.
- Install all the required Python libraries mentioned above.
- Open a Command Prompt/Terminal in the Root Directory of the Project.
- To test an image, run the following script-
python ImageSmileDetection.py
- To test a video, run the following script-
python VideoSmileDetection.py
- There are already some images and videos provided in the Assets folder for testing. To test a different image/video for smile detection, place the desired image/video in the Assets folder in the Root Directory and change the file name on the 10th line of the ImageSmileDetection.py script in the case of an image and 5th line of the VideoSmileDetection.py in the case of a video.
- Enjoy playing around with the scripts!