This project demonstrates how to apply Snapchat-like filters to images using Python and OpenCV. It allows you to overlay various filters, such as mustaches, hats, and sunglasses, onto human faces in images and also apply some cool photo effects.
- Clone the repository:
git clone https://github.com/Praveenanand333/Snapchat-Filters.git
- Navigate to the project directory:
cd Snapchat-Filters
- Install the required dependencies:
pip install -r requirements.txt
Make sure you have Python 3.x and pip installed on your system.
-
Place your images for the filters in the
media
directory. Make sure the images have transparent backgrounds or an alpha channel to allow for proper overlaying. -
Open the
main.py
file and specify the paths to your filter images, such as mustache, hat, or sunglasses. -
Run the application:
python main.py
-
On the gui that appears select an filter to apply the filters to. The application will detect faces in the image and overlay the chosen filters onto the faces.
-
You can also capture and save images by pressing 'c' and to quit an filter press 'q'
You can customize the project according to your needs. Here are some possible modifications:
-
Add new filter images: Place new filter images in the
filters
directory and update themain.py
file with their paths. -
Implement additional filters: Extend the application to include new filter types, such as face masks or funny accessories.
-
Adjust filter placement: Modify the code to adjust the position, size, or rotation of the filters based on the detected face landmarks.
The project utilizes the following resources:
- OpenCV: https://opencv.org/
- Python: https://www.python.org/
- Sample images: Include a section with credits or references to the sample images used in the project.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
- Provide acknowledgments or credits to any external libraries, tutorials, or resources that were helpful in the development of the project.
Feel free to modify this README file to suit your specific project requirements and add any additional sections or information as needed.