Spaces:
Running
Running
Fix
Browse files
app.py
CHANGED
@@ -21,6 +21,7 @@ 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 |
cv2.imwrite(os.path.join("output.png"), img)
|
|
|
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 |
cv2.imwrite(os.path.join("output.png"), img)
|