Spaces:
Running
on
Zero
Running
on
Zero
ohayonguy
commited on
Commit
•
8d5efa4
1
Parent(s):
4942d84
improved interface
Browse files
app.py
CHANGED
@@ -142,10 +142,10 @@ def inference(seed, randomize_seed, img, aligned, scale, num_flow_steps):
|
|
142 |
paste_back=True, num_flow_steps=num_flow_steps, scale=scale)
|
143 |
if has_aligned:
|
144 |
output = restored_aligned[0]
|
145 |
-
input = cropped_face[0]
|
146 |
else:
|
147 |
output = restored_img
|
148 |
-
input =
|
149 |
|
150 |
save_path = f'output/out.png'
|
151 |
cv2.imwrite(save_path, output)
|
@@ -173,8 +173,6 @@ Please refer to our project's page for more details: https://pmrf-ml.github.io/.
|
|
173 |
|
174 |
You may use this demo to enhance the quality of any image which contains faces.
|
175 |
|
176 |
-
If your input image has only one face and it is aligned, please mark "Yes" to the answer below. Otherwise, your image may contain any number of faces (>=1), and the quality of each face will be enhanced separately.
|
177 |
-
|
178 |
*Notes* :
|
179 |
|
180 |
1. Our model is designed to restore aligned face images, but here we incorporate mechanisms that allow restoring the quality of any image that contains any number of faces. Thus, the resulting quality of such general images is not guaranteed.
|
@@ -223,7 +221,7 @@ with gr.Blocks(css=css, theme=gr.themes.Soft()) as demo:
|
|
223 |
gr.Markdown(markdown_top)
|
224 |
|
225 |
with gr.Row():
|
226 |
-
run_button = gr.Button(value="
|
227 |
|
228 |
with gr.Row():
|
229 |
with gr.Column(scale=2):
|
|
|
142 |
paste_back=True, num_flow_steps=num_flow_steps, scale=scale)
|
143 |
if has_aligned:
|
144 |
output = restored_aligned[0]
|
145 |
+
input = cropped_face[0].astype('uint8')
|
146 |
else:
|
147 |
output = restored_img
|
148 |
+
input = img
|
149 |
|
150 |
save_path = f'output/out.png'
|
151 |
cv2.imwrite(save_path, output)
|
|
|
173 |
|
174 |
You may use this demo to enhance the quality of any image which contains faces.
|
175 |
|
|
|
|
|
176 |
*Notes* :
|
177 |
|
178 |
1. Our model is designed to restore aligned face images, but here we incorporate mechanisms that allow restoring the quality of any image that contains any number of faces. Thus, the resulting quality of such general images is not guaranteed.
|
|
|
221 |
gr.Markdown(markdown_top)
|
222 |
|
223 |
with gr.Row():
|
224 |
+
run_button = gr.Button(value="Submit", variant="primary")
|
225 |
|
226 |
with gr.Row():
|
227 |
with gr.Column(scale=2):
|