yifanai / video2anime

Turn your videos (and selfies) into anime with generative adversarial network (GAN)
Other
26 stars 14 forks source link

Supporting higher resolution such as 1024px #2

Closed ofirkris closed 12 months ago

ofirkris commented 5 years ago

Hi, is there an option to add support for higher quality output? I tried using SRgan for this, but result wasn't good enough..

yifanai commented 5 years ago

@ofirkris I believe the existing pretrained checkpoints (original author's and mine) do not support arbitrary image sizes on the fly, because of the MLP function, see: https://github.com/taki0112/UGATIT/blob/2d8596765aa766feff577850cf684190be8fb76a/UGATIT.py#L163. It contains fully connected layers, which have fixed numbers of input connections. The pretrained checkpoints are trained on 256x256 images, so:

If the input image were 1024x1024 for example, then:

So, it might not be possible to have 1 set of weights for all image sizes, because the shapes would conflict. There might be some workarounds:

ofirkris commented 5 years ago

@yifanyf I've tested with this SRGAN implementation https://github.com/goldhuang/SRGAN-PyTorch this is trained with Anime images, also testing now with Anime4K too.

As for higher resolution, I couldn't find a good HQ dataset of Anime faces equivalent to CelebHQ and FFHQ face datasets, are you familiar with HQ anime dace datasets? (Danbooru2018 is 64*64) As for making changes to training code, can you add such? I have several V100 GPU's to train this, and can share the model once I will finish training.

yifanai commented 5 years ago

@ofirkris I was not even able to train 256px images on my GPU with original author's code, got out of memory error :cold_sweat:. I'll dig deeper to see what else can be minified for training.

Have you had success using original repo with --img_size 1024 argument on V100? For higher resolutions, I found something else that might be worth a try: https://github.com/nagadomi/waifu2x and this blog post: https://www.gwern.net/Faces