Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -119,7 +119,12 @@ def inference(img, version, scale, blur_face):
|
|
119 |
cv2.imwrite(save_path, output)
|
120 |
|
121 |
output = cv2.cvtColor(output, cv2.COLOR_BGR2RGB)
|
122 |
-
return
|
|
|
|
|
|
|
|
|
|
|
123 |
except Exception as error:
|
124 |
print('global exception', error)
|
125 |
return None, None
|
@@ -153,7 +158,8 @@ demo = gr.Interface(
|
|
153 |
], [
|
154 |
gr.outputs.Image(type="numpy", label="Output (The whole image)"),
|
155 |
gr.outputs.File(label="Download the output image"),
|
156 |
-
gr.Gallery(label="
|
|
|
157 |
],
|
158 |
title=title,
|
159 |
description=description,
|
|
|
119 |
cv2.imwrite(save_path, output)
|
120 |
|
121 |
output = cv2.cvtColor(output, cv2.COLOR_BGR2RGB)
|
122 |
+
return (
|
123 |
+
output,
|
124 |
+
save_path,
|
125 |
+
[cv2.cvtColor(e, cv2.COLOR_BGR2RGB) for e in face_enhancer.face_helper.org_cropped_faces],
|
126 |
+
[cv2.cvtColor(e, cv2.COLOR_BGR2RGB) for e in face_enhancer.face_helper.restored_faces]
|
127 |
+
)
|
128 |
except Exception as error:
|
129 |
print('global exception', error)
|
130 |
return None, None
|
|
|
158 |
], [
|
159 |
gr.outputs.Image(type="numpy", label="Output (The whole image)"),
|
160 |
gr.outputs.File(label="Download the output image"),
|
161 |
+
gr.Gallery(label="Input faces").style(grid=[2], height="auto"),
|
162 |
+
gr.Gallery(label="Output faces").style(grid=[2], height="auto")
|
163 |
],
|
164 |
title=title,
|
165 |
description=description,
|