jhj0517 commited on
Commit
ba273d9
1 Parent(s): d10784a

Handle img type

Browse files
modules/image_restoration/real_esrgan/wrapper/real_esrganer.py CHANGED
@@ -179,6 +179,9 @@ class RealESRGANer():
179
 
180
  @torch.no_grad()
181
  def enhance(self, img, outscale=None, alpha_upsampler='realesrgan'):
 
 
 
182
  h_input, w_input = img.shape[0:2]
183
  # img: numpy
184
  img = img.astype(np.float32)
 
179
 
180
  @torch.no_grad()
181
  def enhance(self, img, outscale=None, alpha_upsampler='realesrgan'):
182
+ if isinstance(img, str):
183
+ img = cv2.imread(img)
184
+
185
  h_input, w_input = img.shape[0:2]
186
  # img: numpy
187
  img = img.astype(np.float32)