neural_artistic_style icon indicating copy to clipboard operation
neural_artistic_style copied to clipboard

Right & Bottom Border Glitches

Open alexjc opened this issue 9 years ago • 4 comments

This library is pretty awesome! Not using l-bfgs means it's easier to scale up, but it helps to start from random images to find good solutions.

As such, I've been focusing on generating images from purely random seed images. In the process, I've noticed the bottom and right borders seem to have visual glitches where the top and left are fine: http://i.imgur.com/6WQ3NVC.png

I tried looking into the way convolution is setup, but it's in same border_mode as I'd expect and that seems reasonable. I'm wonder how the pixels beyond the image or convolution area are handled. Is this mirroring or something else? Could anything else be causing issues only on two sides?

Thanks!

EDIT: Most other images I have have the same or worse artifacts along the sides, which increase over time but can be reduced by clipping. The image URL here is the highest resolution one I have at hand.

alexjc avatar Sep 14 '15 20:09 alexjc

Good to hear! I think the noise level is an interesting knob to turn during experiments. :)

I believe the border artifacts occur when the image dimensions are not a multiple of 32. This is due to the 5 pooling layers with a downsampling of 2 (2^5 = 32). You can try out different border modes and see if it helps.

andersbll avatar Sep 14 '15 20:09 andersbll

Yep, aligning to 32 pixel boundaries before calling the script fixes those glitches. Thanks!

alexjc avatar Sep 16 '15 20:09 alexjc

Is it important to conform both the source and target images to the multiple of 32 or just the target?

filmo avatar Mar 01 '16 01:03 filmo

Your target and source image should have the same dimensions, right? These dimensions should be a multiple of 32 to minimize border artefacts. I don't think you need to ensure this for the style image.

andersbll avatar Mar 01 '16 07:03 andersbll