KenjieDec commited on
Commit
024a6e3
·
1 Parent(s): 315bfd0
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -21,9 +21,10 @@ def inference(file, mode):
21
  if mode == "enhance":
22
  model = {'name':'GPEN-512', 'size':512}
23
  im = cv2.imread(file, cv2.IMREAD_COLOR)
 
24
  faceenhancer = FaceEnhancement(size=model['size'], model=model['name'], channel_multiplier=2, device='cpu')
25
  img, orig_faces, enhanced_faces = faceenhancer.process(im)
26
- return enhanced_faces[0][:,:,::-1]
27
  else:
28
  model = {'name':'GPEN-1024-Color', 'size':1024}
29
  grayf = cv2.imread(file, cv2.IMREAD_GRAYSCALE)
 
21
  if mode == "enhance":
22
  model = {'name':'GPEN-512', 'size':512}
23
  im = cv2.imread(file, cv2.IMREAD_COLOR)
24
+ im = cv2.resize(im, (0,0), fx=2, fy=2)
25
  faceenhancer = FaceEnhancement(size=model['size'], model=model['name'], channel_multiplier=2, device='cpu')
26
  img, orig_faces, enhanced_faces = faceenhancer.process(im)
27
+ return img
28
  else:
29
  model = {'name':'GPEN-1024-Color', 'size':1024}
30
  grayf = cv2.imread(file, cv2.IMREAD_GRAYSCALE)