Giter Club home page Giter Club logo

style-transfer-from-artwork-to-photograph's Introduction

Project for the Machine Learning Workkshop course, Warsaw Univeristy of Techcnology.

Implements style transfer, based on the method proposed by Gatys et al. (https://arxiv.org/abs/1508.06576). Current implementation is largely based on the code provided by Gatys(https://github.com/leongatys/PytorchNeuralStyleTransfer/blob/master/NeuralStyleTransfer.ipynb).

Usage:

Before running the code, install CUDA on your device to reduce the amount of time style transfer takes. Then install the correct version of PyTorch from the website.

You must download the vgg19 model and install it in the model/vgg19 subdirectory here: https://bethgelab.org/media/uploads/pytorch_models/vgg_conv.pth

also: (from conda interpreter. just doing 'conda install PIL' didnt work for me.) easy_install PIL

To run the gui: In the main folder, run > python gui.py

To run style transfer:

(style.py)

# Set these to the path to the content and style images
CONTENT_IMG_PATH = 'images/old-house.jpg'
STYLE_IMG_PATH = 'styles/van-gogh-cottages.jpg'

# Set to path of output
RESULT_IMG_PATH = 'results/loss_diff_test_cottages.jpg'
PARTIAL_RESULT_IMG_PATH = 'partial_results/house_as_gogh_cottages.jpg'

# Init stylizer
stylizer = Stylizer(content_weight=400, style_weight=1600)

# Run a set number of iterations
stylizer.run(CONTENT_IMG_PATH, STYLE_IMG_PATH, RESULT_IMG_PATH, iterations=100)

style-transfer-from-artwork-to-photograph's People

Contributors

krsuma avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.