anishathalye / neural-style

Neural style in TensorFlow! 🎨
https://anishathalye.com/an-ai-that-can-mimic-any-artist/
GNU General Public License v3.0
5.54k stars 1.52k forks source link

JPEG-like artifacts #100

Closed ErfolgreichCharismatisch closed 6 years ago

ErfolgreichCharismatisch commented 6 years ago

I experience artifacts in every picture that neural-style creates.

zb416

2

Even if I use png as output.

How do I prevent them?

anishathalye commented 6 years ago

Maybe try playing around with total variation (TV) regularization loss weight?

jppgks commented 6 years ago

Here's a Distill article that I enjoyed. It's about this topic.

ErfolgreichCharismatisch commented 6 years ago

@jppgks Beyond me what they did. Please share what to change in anis code to apply it.

jppgks commented 6 years ago

@ErfolgreichCharismatisch If I understand correctly, the artifacts are due to the network (VGG in this case) and what stride and size are used for convolution layers. Seems to me like you would need to tweak the network itself in order to reduce artifacts.

ErfolgreichCharismatisch commented 6 years ago

@jppgks which hyperparameters would you tweak? The total variation (TV) regularization loss weight? I tried by using 50 and 250 and nothing improved.

anishathalye commented 6 years ago

Hmm, the article that @jppgks mentioned is relevant when using an algorithm like Perceptual Losses for Real-Time Style Transfer and Super-Resolution, but I don't think it applies to the algorithm we're using here (we don't have any deconvolution kernels).

Increasing TV weight might help. Another trick you could use is rendering at a higher resolution and then using a smooth downscaling algorithm.

limchaos commented 6 years ago

Hi,I got a problem @anishathalye, which is the generator in this network ,it seems only a VGG19, and I don't think VGG19 can generate a image 🍡 , I mean it's a feature map