saicoco / fast-style-transfer-gui

fast-style-transfer gui program

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fast-style-transfer-gui

fast-style-transfer

A GUI application for fast-style-transfer, also add local style transfer by graghcut which is a algorithm in opencv.

This code test on ubuntu 15.04, gcc4.8.5.

Dependencies:

  • opencv3.1
  • scikit-image(0.11.3)
  • PyQt
  • mxnet(>0.9.5)
  • numpy(1.12.1)
  • matplotlib

First you need to install anaconda, which will help you config enviroments quickly and easily:

opencv3.1

conda install -c https://conda.binstar.org/menpo opencv

PyQt

conda install pyqt

mxnet, numpy, matplotlib, scikit-image

pip install mxnet
pip install numpy
pip install matplotlib
pip install scikit-image

How to run?

After installing dependencise,run following command in current directory:

python main.py

and there will be a GUI showing as following:

1

GUI

Buttons in area of style choices are for style choices, such as sail, head .etc, and area in style image will show the style for the choice;After that, click "open image" button to open a content image,and the image will shows in area of content image; and the content image will show in the area, click "RUN" to get outputs, which will be saved to "out" dir in current dir.

For local style transfer,you can click button "local style" after you choose content image, and will get a dialog showed as following :

3

click two position in image,e.g. left-top and right-bottom,which namely get a rectangle in image,click "RUN", get the outputs as above we mentioned:

4

pre-traned model

There are 12 pretrained models in baidu cloud driver, you can download them and unzip into "mx_transfer". styles show as follows:



TODO

  • Rerun will request more memory because memory for model created by mxnet cannot free well
  • Segmentation needs to optimaze.

Thanks

zhaw/neural_style
lengstrom/fast-style-transfer

ezoic increase your site revenue

About

fast-style-transfer gui program

License:GNU General Public License v3.0


Languages

Language:Python 96.2%Language:C++ 2.5%Language:QMake 1.3%