This is a Deep Dream implementation using PyTorch with pretrained GoogLeNet weights. The algorithm is very simple (doesn'b't use octaves) and aims to be fast. As of now, in a MBP with an i7 it runs in ~2s. The deployed version in Heroku tends to be slower and is not always available.
Here are some of the available styles:
Original | Painting |
---|---|
Mixed | Trippy |
Syd Barret | Whatever |
This API is hosted in heroku. Here is a snippet to quickly try the API using the trippy style:
curl \
-X POST \
-F 'image=@/path/to/source/image.jpeg' \
http://deep-api-23.herokuapp.com/deep/dream/trippy \
--output /path/to/output/image.jpeg
Heroku requests have a timeout of 30s. This time should be enough to run the algorithm, but it's not consistent at all! So it won't work every time.
The Github repo performs a workflow to make sure the Unit Tests are running and checks the PyCodeStyle.
The Heroku app is linked to this repo to perform continous deployment over the master branch.
- Dev Requirements can be installed using:
pip install -r ./support/requirements/dev.txt
. - Heroku Requirements are prepared to install the CPU-only PyTorch version and will work in Linux only.
uwsgi --ini uwsgi.ini
python deep_api