Spaces:
Running
Running
update realesrgan_utils
Browse files73 unmodified lines74757677787980131 unmodified lines21221321421421521621721873 unmodified lines self.img = self.img.half()
# pre_pad self.img_pre_pad = self.img.clone() if self.pre_pad != 0: self.img = F.pad(self.img, (0, self.pre_pad, 0, self.pre_pad), 'reflect') # mod pad for divisible borders131 unmodified lines del output_img_t torch.cuda.empty_cache() except RuntimeError as error: output_img = cv2.resize(output_img, (w_input * self.scale, h_input * self.scale), interpolation=cv2.INTER_LINEAR) output_img = cv2.resize(self.img_pre_pad, (w_input * self.scale, h_input * self.scale), interpolation=cv2.INTER_LINEAR) print(f"Failed inference for RealESRGAN: {error}")
# ------------------- process the alpha channel if necessary ------------------- #CodeFormer/basicsr/utils/realesrgan_utils.py+2-1