martinbenson / deep-photo-styletransfer

Implementation of "Deep Photo Style Transfer": https://arxiv.org/abs/1703.07511
MIT License
204 stars 27 forks source link

Tiling to produce larger outputs #4

Closed ProGamerGov closed 7 years ago

ProGamerGov commented 7 years ago

In order to produce larger outputs, a technique was proposed by @crowsonkb, where tiling is performed by:

"splitting the image into differently offset tiles each iteration, recombining the processed tiles, and applying tile seam suppression."

Memory usage is lowered as per the quote below:

you have to compute the target feature maps and Gram matrices in a tiled way so that you do not run out of memory.

I am not sure of how to apply this technique when using masks, but I believe it should still be doable.

Sources:

https://github.com/crowsonkb/style_transfer/issues/10

https://github.com/jcjohnson/neural-style/issues/329#issuecomment-250325904

martinbenson commented 7 years ago

I totally agree on tiling. I think it makes sense to re-platform the whole thing based on @crowsonkb's code!

martinbenson commented 7 years ago

Given that multi-gpu setting in the code now allows larger images to be produced, I have no immediate intention of introducing tiling. Happy to take a PR though!