Skip to content
Photo-sharing social network built around style transfer. User uploaded photos can be run through a Tensorflow model to generate a new image, blending the content of the photo with the style of a source painting
CSS Python JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


DeepPaint is a photo sharing webapp built to feature the author's interest in style-transfer via Tensorflow. The initial release was built untilizing fast-style-transfer by Logan Engstrom.

Users upload photos, share them with the DeepPaint community, then process those photos through the style-transfer model to generate new images that blend the content and features of the source photo with the style and texture of select paintings.


Getting Started

This project is a full-stack web app that leverages multiple technologies and frameworks. The instructions below are meant to guide you through getting a local instance of Deep-Paint up and running.


On the back-end, this project was written in Python 2.7 using Flask as the web framework, then Flask-SQLAlchemy as the ORM to connect to a PostgreSQL database. The style-transfer neural network was built using Tensorflow. Prior to getting started, you'll need to make sure you have Python 2.7, and PostgreSQL installed.

I built this project on macOS High Sierra 10.13.4, so instructions are written with that OS. If you are running Linux or Windows, your installation steps will be slightly different.

For those of you using macOS, I highly recommend using brew to get started.

Important note: These are the steps that worked for my specific environment. Your environment may have different requirements.

  1. Install Homebrew
$ /usr/bin/ruby -e "$(curl -fsSL"
  1. Install Python 2.7

Using brew:

$ brew install python@2
$ pip install --upgrade pip setuptools
$ pip install virtualenv
  1. Install and setup PostgreSQL
$ brew install postgres
$ brew services start postgresql


  1. Clone this repo and cd into it.
$ git clone
$ cd deep-paint
  1. Create a virtual environment and activate it.
$ virtualenv env
$ . env/bin/activate
  1. Install the required python packages. I've included a pip freeze dump: requirements.txt.
$ pip install -r requirements.txt
  1. Create the file and run it.
$ echo "export SECRET_KEY='<fill-with-a-secret-key>'" >
$ .
  1. Create the postgres databases.
$ createdb deep-paint
$ createdb deep-paint-testing
  1. Seed the starting data. Download the seed files here. Extract the archive to the project directory, then run to populate the db.
$ python
  1. Launch the server.
$ python
  1. Navigate to http://localhost:5000 in a browser window.


  1. Spin up the web server of your preference. The host used for is an AWS EC2 large-t2 instance running Ubuntu 16.4 LTS with the following config:
$ apt-get install -y python-virtualenv
$ apt-get install -y build-essential python-dev
$ apt-get install -y postgresql postgresql-client
$ sudo -u postgres createuser -s ubuntu
$ apt-get install -y postgresql-server-dev-10.3
$ apt-get install -y postgresql-plpython
$ apt-get install -y postgresql-contrib
$ apt-get install -y nginx

1a. The PostgreSQL db will also need to be spun up here. If you've already created the db in your local env, I recommend simply dumping your local db into a .sql file then reading that into the server. On local:

$ pg_dump deep-paint > deep-paint.sql

On server:

$ createdb deep-paint
$ psql deep-paint < deep-paint.sql
  1. Clone this repo on the server and cd into the directory.
$ git clone
$ cd deep-paint
  1. Create a virtual environment and pip install requirements.
$ virtualenv env
$ . env/bin/activate
$ pip install -r requirements.txt
  1. Create a file and add a Flask secret key.
$ echo "export SECRET_KEY='<fill-with-a-secret-key>'" >
  1. Spin up the server and verify it is running.
$ tmux
$ . env/bin/activate
$ .
$ python
$ curl http://localhost:5000
  1. Get an SSL cert from letsenrypt. Note: This step is optional but highly recommended.
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
$ sudo apt-get install python-certbot-nginx
$ sudo certbot --nginx
[enter your domain]
  1. Modify the nginx.conf file with your domain name, to route https traffic to localhost on the server.
... [after modifying nginx.conf]
$ sudo cp nginx.conf /etc/nginx/sites-enabled/[your-domain].conf
$ sudo /etc/init.d/nginx reload

Built With


Please read for details on our code of conduct, and the process for submitting pull requests.


See also the list of contributors who participated in this project.


This project is licensed under the MIT License - see the file for details


You can’t perform that action at this time.