This project implements the portrait mode effect on images using Neural Networks.
Traditionally, the portrait mode effect has been achieved using 2 lenses which detect objects present in the foreground and in the background. With advances in the field of ML, this effect can also be implemented using only image segmentation. Using the pretrained DeepLab-v3+ open source model, we can find the objects in the foreground of the image and blur the background to replicate this effect.
Check out the demo website - Demo (Source Code: https://github.com/mudit9/portraitmode-flask)
This project relies on a handful of dependencies, use the following command to install your dependencies:
pip install -r requirements.txt
Note: Depending on your environment, you may need to use sudo
. You may also want to use virtualenv.
Portrait Mode Effect is used from the command line:
python portrait-mode.py -i samples/input-1.jpg
-i/--image
: specifies the image file.
The script outputs one image in the same directory with the name: input-1-portrait.jpg
python portrait-mode.py -i samples/input-1.jpg
python portrait-mode.py -i samples/input-2.jpg
python portrait-mode.py -i samples/input-3.jpg
- Develop API.
- Develop website.
This project has been developed by:
MIT License - see the LICENSE file for details.