Artist Style Transfer Via Quadratic Potential

栏目: IT技术 · 发布时间: 6年前

内容简介:In this paper we address the problem of artist style transfer where the painting style of a given artist is applied on a real world photograph. We train our neural networks in adversarial setting via recently introduced quadratic potential divergence for s

Artist Style Transfer Via Quadratic Potential

Rahul Bhalley and Jianlin Su

arXiv paper

Abstract

In this paper we address the problem of artist style transfer where the painting style of a given artist is applied on a real world photograph. We train our neural networks in adversarial setting via recently introduced quadratic potential divergence for stable learning process. To further improve the quality of generated artist stylized images we also integrate some of the recently introduced deep learning techniques in our method. To our best knowledge this is the first attempt towards artist style transfer via quadratic potential divergence. We provide some stylized image samples in the supplementary material. The source code for experimentation was written in PyTorch and is available online in my GitHub repository .

If you find our work, or this repository helpful, please consider citing our work with the following BibTex:

@article{bhalley2019artist,
  title={Artist Style Transfer Via Quadratic Potential},
  author={Bhalley, Rahul and Su, Jianlin},
  journal={arXiv preprint arXiv:1902.11108},
  year={2019}
}

NOTE: Pre-trained models are available in Google Drive . Please download it in the root directory of this repository.

Prerequisites

This code was tested in following environment setting:

Usage

First clone this repository:

git clone https://github.com/rahulbhalley/cyclegan-qp.git

Getting Datasets

Enter into the cyclegan-qp directory via terminal.

cd cyclegan-qp

To download the datasets (for instance, ukiyoe2photo ) run:

bash download_dataset.sh ukiyoe2photo

Now ukiyoe2photo dataset will be downloaded and unzipped in cyclegan-qp/datasets/ukiyoe2photo directory.

Training & Inference

To train the network set TRAIN = True in config.py and for inference set it to False . Then one may only need to execute the following command in terminal.

python main.py

Configurations

Following is a list of configurable variables (in config.py ) to perform experiments with different settings.

Data

  • DATASET_DIR - name of directory containing dataset. Default: "datasets" .
  • DATASET_NAME - name of dataset to use. Default: "vangogh2photo" .
  • LOAD_DIM - sets the size of images to load. Default: 286 .
  • CROP_DIM - square crops the images from center. Default: 256 .
  • CKPT_DIR - name of directory to save checkpoints in. Default: "checkpoints" .
  • SAMPLE_DIR - directory name where inferred samples will be saved. Default: "samples" .

Quadratic Potential

  • LAMBDA - see equation (1) in paper . Default: 10.0 .
  • NORM - see equation (2) in paper . Possible values: "l1" , "l2" . Default: "l1" .

CycleGAN-QP

  • CYC_WEIGHT - cycle consistency weight. Default: 10.0 .
  • ID_WEIGHT - identity weight. Default: 0.5 .

Network

  • N_CHANNELS - number of channels of images in dataset. Set to 3 for RGB and 1 for grayscale. Default: 3 .
  • UPSAMPLE - set True to use ( Odena et al., 2016 ) technique but False to use vanilla transpose convolution layers in generator networks. Default: True .

Training

  • RANDOM_SEED - random seed to reproduce the experiments. Default: 12345 .
  • BATCH_SIZE - batch size for training. Default: 4 .
  • LR - learning rate. Default: 2e-4 .
  • BETA1 - hyper-parameter of Adam optimizer. Default: 0.5 .
  • BETA2 - hyper-parameter of Adam optimizer. Default: 0.999 .
  • BEGIN_ITER - if 0 the train begins from start but when set to > 0 then training continues from BEGIN_ITER th checkpoint. Default: 0 .
  • END_ITER - number of iteration for training. Default: 15000 .
  • TRAIN - set True for training CycleGAN-QP but False to perform inference (for more inference configurations see next subsection). Default: True .

Inference

  • INFER_ITER - performs inference by loading parameters from this checkpoint. Default: 15000 .
  • INFER_STYLE - style to be transferred on images. Possible values: "ce" , "mo" , "uk" , "vg" . Default: "vg" .
  • IMG_NAME - name of image to be performed inference on. Default: "image.jpg" .
  • IN_IMG_DIR - name of directory containing IMG_NAME . Default: "images" .
  • OUT_STY_DIR - name of directory to save inferred IMG_NAME . Default: "sty" .
  • OUT_REC_DIR - name of directory to save recovered (original) IMG_NAME . Default: "rec" .
  • IMG_SIZE - set None to infer with the original sized IMG_NAME or set some integral value to infer with IMG_SIZE . Default: None .

Logs

  • ITERS_PER_LOG - iterations duration at which screen logs should be made. Default: 100
  • ITERS_PER_CKPT - iterations duration at which checkpoints should be saved. Default: 1000

Results

The images in each column (from left to right) corresponds to:

  • Original image
  • Paul Cézanne
  • Claude Monet
  • Ukiyo-e
  • Vincent Van Gogh.

And each row contains a different image.

Real Image to Stylized Image

Artist Style Transfer Via Quadratic Potential

Stylized Image to Real Image

Artist Style Transfer Via Quadratic Potential

Contact

For queries contact me at rahulbhalley@protonmail.com .


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

科技投资新时代:TMT投资方法、趋势与热点聚焦

科技投资新时代:TMT投资方法、趋势与热点聚焦

马军、宋辉、段迎晟 / 人民邮电出版社 / 2018-3 / 69.00

中国 TMT 行业(科技、媒体及通信)起步较晚但充满朝气。2017 年,TMT 板块的IPO 数量占到了总数的四分之一;对于投资者来说,投资 TMT 的收益非常可观。那么,TMT 的投资趋势如何? TMT 行业又有哪些投资热点? 本书立足于 TMT 投资现状,在介绍了 TMT 投资的基本概念之后,作者详细讲述了TMT 投资的基本研究方法、分析视角、整体行情及趋势分析,同时从行业视角分析了包括......一起来看看 《科技投资新时代:TMT投资方法、趋势与热点聚焦》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

html转js在线工具
html转js在线工具

html转js在线工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具