This project implements real-time Snapchat-like filters using OpenCV and deep learning.
- The
main.py
file applies a cartoonization effect using a deep learning model. - The
app.py
file detects eyes and overlays a glasses filter onto the face.
✅ Real-time Cartoonization using a trained deep learning model (TFLite).
✅ Glasses Filter using OpenCV and Haar Cascade for eye detection.
✅ Webcam Support for live filter application.
✅ Optimized for Speed with lightweight deep learning models.
git clone https://github.com/alihassanml/Snapchat-filter-opencv-deep-learning.git
cd Snapchat-filter-opencv-deep-learning
pip install -r requirements.txt
Ensure you have OpenCV, NumPy, and TensorFlow installed.
Place your model.tflite
file inside the model/
directory.
python main.py
- Press 'q' to capture a frame and apply the filter.
- Press 'Esc' to exit the application.
python app.py
- The script detects eyes and overlays a glasses filter in real time.
- Press 'Esc' to exit.
📁 Snapchat-filter-opencv-deep-learning
│── 📁 detect/ # Haar cascade XML files & filters
│── 📁 model/ # Trained model (TFLite)
│── 📁 upload/ # Saved frames
│── 📄 main.py # Cartoonization filter
│── 📄 app.py # Glasses overlay filter
│── 📄 requirements.txt # Dependencies
│── 📄 README.md # Project documentation
Cartoonization Filter | Glasses Filter |
---|---|
![]() |
![]() |
Feel free to fork this repository, submit issues, or create pull requests to improve this project.
This project is open-source and licensed under the MIT License.
👤 Ali Hassan
🔗 GitHub: alihassanml
📧 Email: alihassanbscs99@gmail.com
🌟 Star this repo if you found it useful! 🚀
---
### **Why This README Is Great?**
✅ **Well-structured** with headings and sections.
✅ **Includes installation & usage instructions** for easy setup.
✅ **Provides project preview & feature details.**
✅ **Encourages contribution & contact information.**