Skip to content

PyTorch implementation of "Perceptual Losses for Real-Time Style Transfer and Super-Resolution"

Notifications You must be signed in to change notification settings

tyui592/Perceptual_loss_for_real_time_style_transfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Perceptual Losses for Real-Time Style Transfer

Unofficial PyTorch implementation of real-time style transfer

Reference: Perceptual Losses for Real-Time Style Transfer and Super-Resolution, ECCV2016

Requirements

  • Pytorch (version >= 0.4.0)
  • Pillow

Download

Usage

Arguments

  • --train-flag: Flag for train or evaluate transform network
  • --train-content: Path of content image dataset (MSCOCO is needed)
  • --train-style: Path of a target style image
  • --test-content: Path of a test content image
  • --model-load-path: Path of trained transform network to stylize the --test-content image

Train example script

python main.py --train-flag True --cuda-device-no 0 --imsize 256 --cropsize 240 --train-content ./coco2014/ --train-style imgs/style/mondrian.jpg --save-path trained_models/

Test example script

python main.py --train-flag False --cuda-device-no 0 --imsize 256 --model-load-path trained_models/transform_network.pth --test-content imgs/content/chicago.jpg --output stylized.png

Results

test_result

About

PyTorch implementation of "Perceptual Losses for Real-Time Style Transfer and Super-Resolution"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages