Giter VIP home page Giter VIP logo

neural_style's Introduction

Neural Style

style transfer with mxnet

Requirements

  • Install skimage via pip: sudo pip install scikit-image
  • Install CUDA and Cudnn
  • Install Mxnet, please set "USE_NVRTC = 1" in config.mk before compiling
  • Download pretrained VGG model and save it to the root of this repository.
  • Download MSCOCO dataset if you want to train models.

Usage

Folder mrf_cnn implements Combining Markov Random Fields and Convolutional Neural Networks for Image Synthesis. It is an optimization based method, can provide delicate result but is slow. Original Torch version

Folder perceptual implements Perceptual Losses for Real-Time Style Transfer and Super-Resolution. It trains a network to do optimization and is very fast. Original Torch version

Folder texturenet implements Texture Networks: Feed-forward Synthesis of Textures and Stylized Images. It also trains a network to do optimization. Original Torch version

Folder fast_mrf_cnn trains network to do optimization in mrf_cnn. It is very fast and can give result similar to but not as good as mrf_cnn.

Folder old_stuff contains some pretrained texture network models.

neural_style's People

Contributors

mikeinnes avatar zhaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

neural_style's Issues

Mirror for trained models

I'm struggling to download the trained models from the Baidu page linked here – it gives me a very slow or 0 download speed when I try it. Would be hugely grateful if anyone had a download mirror (e.g. bittorrent, github release, something else).

amazing work!

nice work, it looks these models can create so crazy images! are these pkl models generated or pretrained by some method in mxnet? if i can generate my own style, how could i? thanks!

I get a black picture

I follow your Setup list , but

import make_image
make_image.make_image('test_pics/city.jpg', '9', 'out/9_city.jpg')

get a black picture

is there any env wrong ?

suker@suker:neural_style$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import make_image
make_image.make_image('test_pics/city.jpg', '9', 'out/91_city.jpg')
/usr/local/lib/python2.7/dist-packages/skimage/io/_io.py:132: UserWarning: out/91_city.jpg is a low contrast image
warn('%s is a low contrast image' % fname)

mrf-cnn differs from the paper

when review the code of mrf_cnn, i found the nearest patch(target_patch0, target_patch1) are fixed for each scale but not update them during each iteration. I suppose it is different from the paper, though it makes the iterations much faster. Is that because the modification would not harm the performance or me misunderstood the original paper?
great work with mxnet, btw.

There's dark band on the right side of the output image

While processing faces, I found that on the right side of the output image, there's a narrow bind which is darker than nearby places. That's especially obvious for tmp0.jpg, see the picture below for detail.

Another problem: I trid to execute train.py in "perceptual" folder to train models,but encountered this:

import train as tr
tr.train_style(0.3,'models/s5','style/picasso.jpg')
[17:49:48] /home/chaoxin/mxnet/dmlc-core/include/dmlc/logging.h:235: [17:49:48] /home/chaoxin/mxnet/mshadow/mshadow/./random.h:328: Check failed: (status) == (CURAND_STATUS_SUCCESS) CURAND Gen Normal float failed. size = 7776,mu = 0,sigma = 1e-08
[17:49:48] /home/chaoxin/mxnet/dmlc-core/include/dmlc/logging.h:235: [17:49:48] src/engine/./threaded_engine.h:306: [17:49:48] /home/chaoxin/mxnet/mshadow/mshadow/./random.h:328: Check failed: (status) == (CURAND_STATUS_SUCCESS) CURAND Gen Normal float failed. size = 7776,mu = 0,sigma = 1e-08
An fatal error occurred in asynchronous engine operation. If you do not know what caused this error, you can try set environment variable MXNET_ENGINE_TYPE to NaiveEngine and run with debugger (i.e. gdb). This will force all operations to be synchronous and backtrace will give you the series of calls that lead to this error. Remember to set MXNET_ENGINE_TYPE back to empty after debugging.
terminate called after throwing an instance of 'dmlc::Error'
what(): [17:49:48] src/engine/./threaded_engine.h:306: [17:49:48] /home/chaoxin/mxnet/mshadow/mshadow/./random.h:328: Check failed: (status) == (CURAND_STATUS_SUCCESS) CURAND Gen Normal float failed. size = 7776,mu = 0,sigma = 1e-08
An fatal error occurred in asynchronous engine operation. If you do not know what caused this error, you can try set environment variable MXNET_ENGINE_TYPE to NaiveEngine and run with debugger (i.e. gdb). This will force all operations to be synchronous and backtrace will give you the series of calls that lead to this error. Remember to set MXNET_ENGINE_TYPE back to empty after debugging.

What's the matter?

Which pictures are used (perceptual)?

Hi, thanks for the great implementation! :)

I was wondering if you can tell me which style files were used to generate the perceptual pretrained models here (s0 - s21)

Will you please explain the params

Will you please explain the parameters, such as
--content-weight ,why it can be an array, not just a number;
--style-size, why you use this, isn't '--size'enough?
--num-res, --num-rotation, num-scale, --patch-size and so on

name 'relu1_2' is not defined

I am not familiar with symbol. When I try to run the script.py,it occured an error.

Traceback (most recent call last):
File "script.py", line 4, in
train.train_style(img_path='../../perceptual/image%s.jpg'%st, model_prefix='s%d'%i, alpha=2e-1, max_epoch=20000)
File "F:\Shared3\hzq\neural_style-master\perceptual\train.py", line 138, in train_style
desc_executor, gram_executors, gene_executor = init_executor(batch_size, weights=weights, style_layers=style_layer, content_layer=content_layer)
File "F:\Shared3\hzq\neural_style-master\perceptual\train.py", line 93, in init_executor
descriptor = symbol.descriptor_symbol(content_layer=content_layer, style_layers=style_layers)
File "F:\Shared3\hzq\neural_style-master\perceptual\symbol.py", line 72, in descriptor_symbol
style_out = mx.sym.Group([x for x in map(eval, style_layers)])
File "F:\Shared3\hzq\neural_style-master\perceptual\symbol.py", line 72, in
style_out = mx.sym.Group([x for x in map(eval, style_layers)])
File "", line 1, in
NameError: name 'relu1_2' is not defined

I have no idea,please help

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.