XPixelGroup / BasicSR

Open Source Image and Video Restoration Toolbox for Super-resolution, Denoise, Deblurring, etc. Currently, it includes EDSR, RCAN, SRResNet, SRGAN, ESRGAN, EDVR, BasicVSR, SwinIR, ECBSR, etc. Also support StyleGAN2, DFDNet.
https://basicsr.readthedocs.io/en/latest/
Apache License 2.0
6.88k stars 1.2k forks source link

when using grey img with human'face,it doesn't work #705

Open dosudo opened 1 month ago

dosudo commented 1 month ago

the wrong information:File "/home/ubuntu/anaconda3/envs/env1/lib/python3.12/site-packages/facexlib/utils/face_restoration_helper.py", line 354, in paste_faces_to_input_image upsample_img = inv_soft_mask pasted_face + (1 - inv_soft_mask) upsample_img


ValueError: operands could not be broadcast together with shapes (1404,2000,1) (1404,2000)

Because when using grey img with human's face, it run the coding block of if and that block can't change the grey img to three dimension.

the solution is move the line 346 and line 347 out of the coding block of else.