Spaces:
Running
Running
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
|
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)
|