pfnet / PaintsChainer

line drawing colorization using chainer
https://paintschainer.preferred.tech/
MIT License
3.77k stars 557 forks source link

Aspect ratios of the input and output images are different #53

Closed liamjones closed 7 years ago

liamjones commented 7 years ago

The output image used to have the same aspect ratio as the input image in the original version, since then a change has resulted in the output image being squished.

I believe the cause was this code removal: https://github.com/pfnet/PaintsChainer/commit/963e2da553487a473aeb6abd89808323e8cbc2f0#diff-bfd7a84bc84a48c1888381141bfa873b

I'm not certain if it should be JavaScript that goes back in as the fix though. If it did, the webpage display would be correct but users downloading the output image would save one with the wrong aspect ratio.

Potentially better solution; the server side code does a final image resize back to the original aspect ratio when it's finished processing. This way if someone downloads the output image the aspect ratio will be same as the original (even if the image is now smaller).

taizan commented 7 years ago

It is needed to resize the input image to multiple of 16 otherwse, NN will crush... so server side resize is better but its a little bit cpu cost