ProGamerGov / neural-style-pt

PyTorch implementation of neural style transfer algorithm
MIT License
833 stars 178 forks source link

init_image #50

Closed spot92 closed 4 years ago

spot92 commented 4 years ago

What does it mean to replace the initialization image?

ProGamerGov commented 4 years ago

By default an image composed of random pixel color values is used to start the style transfer process. If you use -init image then the image used to start the style transfer process is a copy of the content image. -init_image is used to replace this copy of the content image with a user specified third image.

The -init_image parameter was added to the original neural-style to improve multiscale generation (multires).

In the example below, a random initialization image is used for step 1. Then in order to speed up the multiscale generation process while preserving some information from the original content image, the past step's output is used to initialize the second style transfer step:

python3 neural_style.py -output_image out1.png -image_size 512

python3 neural_style.py -output_image out2.png -init image -init_image out1.png -image_size 720

python3 neural_style.py -output_image out3.png -init image -init_image out2.png -image_size 1024

python3 neural_style.py -output_image out4.png -init image -init_image out3.png -image_size 1536
spot92 commented 4 years ago

Awesome, thanks

ProGamerGov commented 4 years ago

I've created two sets of guides which will farther illustrate how multiscale generation works along with how different parameters affect the output image:

https://github.com/ProGamerGov/neural-style-pt/wiki/Choosing-Parameters-for-Beginners

https://github.com/ProGamerGov/neural-style-pt/wiki/Multiscale-Generation-for-Beginners

spot92 commented 4 years ago

Sweet! I will look at these. Thanks again for all this.

spot92 commented 4 years ago

What video card was the tutorial/example run on?

ProGamerGov commented 4 years ago

Either a Tesla K80, or a Tesla T4.