This project implements the portrait mode effect on images using Neural Networks.
You can find the heroku demo here
The heroku 30 second request limit sometimes causes the request to timeout which is why it's better to use it on the local flask server.
Traditionally, the portrait mode effect has been achieved using 2 lenses which detect ojects 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 - http://portraitmode.herokuapp.com/
This project relies on a handful of dependencies, use the following command to install your dependencies:
git clone https://github.com/mudit9/portraitmode-flask
cd portraitmode-flask
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 app.py
Then open http://127.0.0.1:5000/ in the browser
- Develop API.
- Develop website.
This project has been developed by:
MIT License - see the LICENSE file for details.