sczhou / CodeFormer

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

Background upscale isn't working / Real-ESRGAN ignored? #40

Open AlonDan opened 1 year ago

AlonDan commented 1 year ago

Hello, Thank you for this great project! 💙

I'm running this on Windows 10 and Anaconda, Installation was very easy and simple to follow thanks to your step-by-step instructions, I appreciate it.

Problem Description:

I've added the argument: --bg_upsampler realesrgan But it seems to ignore it and just upscale the face without the background, I get this warning:

inference_codeformer.py:22: RuntimeWarning: The unoptimized RealESRGAN is slow on CPU. We do not use it. If you really want to use it, please modify the corresponding codes.
  warnings.warn('The unoptimized RealESRGAN is slow on CPU. We do not use it. '
Face detection model: retinaface_resnet50
Background upsampling: False, Face upsampling: False
Processing: 5a.png
        detect 1 faces

All results are saved in results/_SOURCE__0.7

Since I'm not a programmer I don't know how to fix or mess with code in general, Can you please tell me how to make it work?

Thanks ahead!

sczhou commented 1 year ago

Update to support running on CPU.

If there is a GPU in your workstation, you may need to check if your PyTorch was installed correctly, and make sure it is compatible with your CUDA version.

AlonDan commented 1 year ago

Thanks @sczhou 💙 I do have GPU, I guess when I followed the installation steps, I skipped the Pytorch one, it is saying that it's required but as a newbie I didn't visit the website, copy the command and installed it.

Off Topic Suggestion: I also noticed in the new version video is supported, maybe in the future it will also support interpolation between the images because at the moment I notice flickering between each frame especially in the mouth, teeth and eyes, but it is obvious as it generates a new image every frame and no interpolation which could be amazing! Just a suggestion if it possible of course.

sczhou commented 1 year ago

Thanks for this suggestion, maybe a video algorithm with frame propagation could help with temporal consistency.

AlonDan commented 1 year ago

It will be amazing to have this within CodeFormer!

In case this information helps: The few I tried called: "DainApp" and the more advanced one I believe is: "FlowFrames" Both are VERY good in video interpolation and slow motion as well but a good start for CodeFormer will be the interpolation by itself of course.

sczhou commented 1 year ago

Video interpolation could be an effective engineering solution for this case, but we will prioritize the algorithm updates, e.g., a video version of CodeFormer with recurrent frame propagation, which could be a better solution for this issue. Will consider it in our future work. 🤗

arquehi commented 3 months ago

Background upscale isn't working on apple silicon device