sczhou / CodeFormer

[NeurIPS 2022] Towards Robust Blind Face Restoration with Codebook Lookup Transformer
Other
15.88k stars 3.34k forks source link

Produce images without upscaling (I need to keep original resolution) if its smaller FullHD? #159

Open suphamster opened 1 year ago

suphamster commented 1 year ago

In web version if I set Rescaling_Factor to 1.99 then I'm getting image almost the same resolution (1% smaller) as original. In cmd if I set "--upscale 1" images becames about twice larger (I mean its resolution) and smaller values it doesn't allows.

suphamster commented 1 year ago

All seems fine is using CodeFormer with FullHD images so closing. Test ones was smaller that why it was upsampled.

suphamster commented 1 year ago

I've reopened this because I don't want any upscaling at all if "--upscale 1" set not just for big resolutions.

sebaro commented 1 year ago

Using replicate https://replicate.com/sczhou/codeformer

For portrait images (height larger than width), if the image width is smaller than 512px the output width is 512 x upscale, so small images are resized to 512px in width, then upscaled: 500x686 -> upscale 1 -> 512x702 500x686 -> upscale 2 -> 1024x1404

The same for landscape images (width larger than height), if the image height is smaller than 512px the output height is 512 x upscale, so small images are resized to 512px in height, then upscaled: 600x511 -> upscale 1 -> 601x512 600x511 -> upscale 2 -> 1202x1024

brohiy commented 11 months ago

![Uploading Snapchat-18765837.jpg…]()

brohiy commented 11 months ago

Ee

brohiy commented 11 months ago

Hhbdhe