KenjieDec commited on
Commit
84d9073
·
1 Parent(s): 3455147

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -28,12 +28,10 @@ def inference(file, mode):
28
  cv2.imwrite(os.path.join("output.png"), img)
29
  return os.path.join("output.png")
30
  else:
31
- emodel = {'name':'GPEN-512', 'size':512}
32
  im = cv2.imread(file, cv2.IMREAD_COLOR)
33
  im = cv2.resize(im, (0,0), fx=2, fy=2)
34
- faceenhancer = FaceEnhancement(size=model['size'], model=emodel['name'], channel_multiplier=2, device='cpu')
35
  img, orig_faces, enhanced_faces = faceenhancer.process(im)
36
- cv2.imwrite(os.path.join("enhanced.png"), img)
37
 
38
  model = {'name':'GPEN-1024-Color', 'size':1024}
39
  grayf = cv2.imread("enhanced.png", cv2.IMREAD_GRAYSCALE)
 
28
  cv2.imwrite(os.path.join("output.png"), img)
29
  return os.path.join("output.png")
30
  else:
 
31
  im = cv2.imread(file, cv2.IMREAD_COLOR)
32
  im = cv2.resize(im, (0,0), fx=2, fy=2)
33
+ faceenhancer = FaceEnhancement(size=512, model='GPEN-512', channel_multiplier=2, device='cpu')
34
  img, orig_faces, enhanced_faces = faceenhancer.process(im)
 
35
 
36
  model = {'name':'GPEN-1024-Color', 'size':1024}
37
  grayf = cv2.imread("enhanced.png", cv2.IMREAD_GRAYSCALE)