jhj0517 commited on
Commit
ef01078
·
1 Parent(s): 37c77b9

Update precision

Browse files
modules/image_restoration/real_esrgan/real_esrgan_inferencer.py CHANGED
@@ -93,7 +93,8 @@ class RealESRGANInferencer:
93
  )
94
 
95
  try:
96
- output, img_mode = self.model.enhance(img_path, outscale=scale)
 
97
  if img_mode == "RGB":
98
  output = cv2.cvtColor(output, cv2.COLOR_RGB2BGR)
99
 
 
93
  )
94
 
95
  try:
96
+ with torch.autocast(device_type=self.device, enabled=(self.device == "cuda")):
97
+ output, img_mode = self.model.enhance(img_path, outscale=scale)
98
  if img_mode == "RGB":
99
  output = cv2.cvtColor(output, cv2.COLOR_RGB2BGR)
100