This project basically involves the use of OPEN CV.
In this masking is done live , i.e you are infront of your webcam , at that time masking will be done.
First detect the face using haarcascade frontal face classifier and then resize the thug mask according the face size and then
paste it over the face detected. Do the necessary conversions like converting array to image and vice versa as explained in the Thug Life.py file.
- Download open cv by typing this
pip install opencv-python
in command prompt if you are using python ide. - If you are using Anaconda then install opencv by typing this
conda install -c conda-forge opencv
in Anaconda Prompt. - You also need to install pillow for placing mask over the image. You can download that by running
pip install pillow
command in command prompt. - After this download the mask image and haarcascade file from this repository .
- Keep the code file , mask image and haarcascade file in the same folder and run the code .
- An output image is there , basically output is not an image, I have just taken a frame from the output to show you what kind of result you will get.
1 - Opencv - https://github.com/opencv/opencv
2 - Anaconda - https://anaconda.org/