Snappy2 detects faces in images and applies custom image filters as overlays. With Snappy2, developers can easily add fun and engaging image filters to their applications.
MIT License
Snappy2 provides a user-friendly way to create fun and engaging image overlays. It uses a neural network to detect face keypoints to draw overlays such as glasses, mustaches, hats, ears, and custom overlays on the face. The library is easy to use and comes with several code examples to get started quickly with a variety of drawing options:
The library is designed to be easy and has several code examples to help users get started quickly.
Snappy2 can be easily installed using pip:
pip install snappy2
Download the required libraries for code using following terminal command:
cd requirements
pip install -r requirements.txt
cd ..
python Demo.py
from snappy2 import Snappy2
snappy = Snappy2()
human_image = snappy.load_image('<file_path>')
snappy.set_mustache(human_image, mus_index=0)
snappy = Snappy2()
human_image = snappy.load_image('<file_path>')
snappy.set_glasses(human_image, gls_index=0)
snappy = Snappy2()
human_image = snappy.load_image('<file_path>')
snappy.set_ears(human_image, gls_index=0)
For more examples and code details check (Demo.py) For GPU optimized version, download the code from this brunch.
This library utilizes photos that are freely accessible on the web. If any of the example photos have licensing restrictions, please reach out to the library owner directly for clarification or removal.
The MIT License (MIT)
Copyright (c) 2017 Ahmad Barqawi (github.com/Barqawiz)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.