ohayonguy
commited on
Commit
·
5cd4a52
1
Parent(s):
9c41d8f
improved interface
Browse files
app.py
CHANGED
@@ -126,8 +126,6 @@ def inference(seed, randomize_seed, img, aligned, scale, num_flow_steps):
|
|
126 |
|
127 |
if h < 300:
|
128 |
img = cv2.resize(img, (w * 2, h * 2), interpolation=cv2.INTER_LANCZOS4)
|
129 |
-
h = h * 2
|
130 |
-
w = w * 2
|
131 |
|
132 |
face_helper = FaceRestoreHelper(
|
133 |
scale,
|
@@ -151,8 +149,8 @@ def inference(seed, randomize_seed, img, aligned, scale, num_flow_steps):
|
|
151 |
cv2.imwrite(save_path, output)
|
152 |
|
153 |
output = cv2.cvtColor(output, cv2.COLOR_BGR2RGB)
|
|
|
154 |
orig_input = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
155 |
-
output = cv2.resize(output, (h, w), interpolation=cv2.INTER_LINEAR)
|
156 |
orig_input = cv2.resize(orig_input, (h, w), interpolation=cv2.INTER_LINEAR)
|
157 |
return [[orig_input, output, seed], save_path]
|
158 |
|
@@ -261,7 +259,7 @@ with gr.Blocks(css=css) as demo:
|
|
261 |
run_button = gr.Button(value="Run")
|
262 |
|
263 |
with gr.Row():
|
264 |
-
with gr.Column(scale=
|
265 |
input_im = gr.Image(label="Input Image", type="filepath")
|
266 |
with gr.Column(scale=1):
|
267 |
num_inference_steps = gr.Slider(
|
|
|
126 |
|
127 |
if h < 300:
|
128 |
img = cv2.resize(img, (w * 2, h * 2), interpolation=cv2.INTER_LANCZOS4)
|
|
|
|
|
129 |
|
130 |
face_helper = FaceRestoreHelper(
|
131 |
scale,
|
|
|
149 |
cv2.imwrite(save_path, output)
|
150 |
|
151 |
output = cv2.cvtColor(output, cv2.COLOR_BGR2RGB)
|
152 |
+
h, w = output.shape[0:2]
|
153 |
orig_input = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
|
|
154 |
orig_input = cv2.resize(orig_input, (h, w), interpolation=cv2.INTER_LINEAR)
|
155 |
return [[orig_input, output, seed], save_path]
|
156 |
|
|
|
259 |
run_button = gr.Button(value="Run")
|
260 |
|
261 |
with gr.Row():
|
262 |
+
with gr.Column(scale=2):
|
263 |
input_im = gr.Image(label="Input Image", type="filepath")
|
264 |
with gr.Column(scale=1):
|
265 |
num_inference_steps = gr.Slider(
|