zhiweili commited on
Commit
ccf29a6
·
1 Parent(s): 1316ef0

change scale

Browse files
Files changed (1) hide show
  1. enhance_utils.py +2 -2
enhance_utils.py CHANGED
@@ -41,7 +41,7 @@ face_enhancer = GFPGANer(model_path='GFPGANv1.4.pth', upscale=2, arch='clean', c
41
  def enhance_image(
42
  pil_image: Image,
43
  enhance_face: bool = False,
44
- scale: int = 2,
45
  ):
46
  face_enhancer.upscale = scale
47
  img = cv2.cvtColor(np.array(pil_image), cv2.COLOR_RGB2BGR)
@@ -52,7 +52,7 @@ def enhance_image(
52
  if enhance_face:
53
  _, _, output = face_enhancer.enhance(img, has_aligned=False, only_center_face=True, paste_back=True)
54
  else:
55
- output, _ = upsampler.enhance(img, outscale=2)
56
  pil_output = Image.fromarray(cv2.cvtColor(output, cv2.COLOR_BGR2RGB))
57
 
58
  return pil_output
 
41
  def enhance_image(
42
  pil_image: Image,
43
  enhance_face: bool = False,
44
+ scale: int = 4,
45
  ):
46
  face_enhancer.upscale = scale
47
  img = cv2.cvtColor(np.array(pil_image), cv2.COLOR_RGB2BGR)
 
52
  if enhance_face:
53
  _, _, output = face_enhancer.enhance(img, has_aligned=False, only_center_face=True, paste_back=True)
54
  else:
55
+ output, _ = upsampler.enhance(img, outscale=scale)
56
  pil_output = Image.fromarray(cv2.cvtColor(output, cv2.COLOR_BGR2RGB))
57
 
58
  return pil_output