Spaces:
Sleeping
Sleeping
update realesrgan_utils
Browse files73 unmodified lines747576777879131 unmodified lines21121221321421521621773 unmodified linesself.img = self.img.half()# pre_padif 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 linesdel output_img_ttorch.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)print(f"Failed inference for RealESRGAN: {error}")# ------------------- process the alpha channel if necessary ------------------- #73 unmodified lines74757677787980131 unmodified lines21221321421521621721873 unmodified linesself.img = self.img.half()# pre_padself.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 linesdel output_img_ttorch.cuda.empty_cache()except RuntimeError as error: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