jcjohnson / neural-style

Torch implementation of neural style algorithm
MIT License
18.3k stars 2.71k forks source link

Style transfer gives blotchy results? #462

Open stalagmite7 opened 5 years ago

stalagmite7 commented 5 years ago

Been trying to transfer some style onto a content image, but the resultant transferred image appears to have a variation in brightness (or saturation) in some regions. Not sure why.

Content image: image

Style image: image

resultant image: image

I've tried changing the parameters for the style transfer but no luck there. Is this perhaps because in the original content image, the sky area is essentially feature-less? That seems to be where the transfer fails and looks duller than the more bright central region. And is there a way to fix this? I have even tried with removing higher relu layers while initiating the transfer, but it only looks worse, more of the image is blotchy and dull than in the image shown above.

rahidz commented 5 years ago

I'm not having any better luck, the problem is whenever I decrease content_weight, it helps on the sky issue, but makes the rest of the image more like a jumble of cheetos than anything resembling the original photo, and vice versa. I wonder if it's the shadows the cheetos form that's the issue.

my best attempt was using these parameters, it makes the sky look more "random" at least, though still with those blotches...also his hands are not cheeto

-num_iterations 2000 -image_size 800 -output_image cheetocowboy.png -backend cudnn -cudnn_autotune -style_scale 0.75 -content_weight 2.5 -style_weight 1000 -tv_weight 0 -save_iter 200 -original_colors 0 -init random

cheetocowboy_2000

Edit: For comparison, here's what the app Cheetos Vision (what kind of simulation do we live in...) produced:

wtf

I prefer my texture and Cheeto size, but whatever they did on the sky worked better than it did for us.

ProGamerGov commented 5 years ago

Maybe try using -init image, and higher content/style weight values while preserving the ratio? Also looks like the app in question is using a lower style weight, like maybe 0.5-0.75.