A website that applies artistic styles to your photo. Based on the Artistic Style Transfer using Neural Networks. This project is an extension of Style transfer app
Live at bit.ly/stylizeapp
Hosted using AWS EC2, AWS S3, Gunicorn and Flask.
-
Clone the repository
git clone https://github.com/puneet29/stylizeapp.git cd stylizeapp
-
Create new virtual environment
-
On windows:
py -3 -m venv venv
-
On Linux:
python3 -m venv venv
-
-
Activate virtual environment
-
On windows:
venv\Scripts\activate
-
On Linux:
. venv/bin/activate
-
-
Install all the dependencies
pip3 install -r requirements
-
Change the secret key in
__init__.py
at #19. Replaceos.urandom(24)
with actual bytes value. -
Run Web App
gunicorn -w 4 -t 600 __init__:app
Follow the same procedure, except 6th step. While running webapp we want the process to be daemonized, so that it runs in the background. For that:
-
Run Web App
gunicorn -b 0.0.0.0:80 -w 4 -t 600 __init__:app -D
We bind our application to all HTTP IPv4 addresses on the server using 0.0.0.0:80 and run 4 gunicorn processes that serve our application. The timeout for each gunicorn worker is set to 600 seconds, to account for 10 min delay during uploading process. -D option daemonizes the process.
Refer to this medium article on how I built this app. Also refer to this gist on how to setup an AWS EC2 instance.
- Pytorch
- Flask
- Scipy
- Gunicorn
- Boto3
- Beautiful Soup 4
- Requests