Spaces:
Running
on
L4
Running
on
L4
upgrade gradio 3.24.0.
Browse files
README.md
CHANGED
@@ -4,8 +4,7 @@ emoji: 🐼
|
|
4 |
colorFrom: blue
|
5 |
colorTo: green
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 3.
|
8 |
-
python_version: 3.10.9
|
9 |
app_file: app.py
|
10 |
pinned: false
|
11 |
---
|
|
|
4 |
colorFrom: blue
|
5 |
colorTo: green
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 3.24.0
|
|
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
app.py
CHANGED
@@ -110,6 +110,11 @@ def inference(image, background_enhance, face_upsample, upscale, codeformer_fide
|
|
110 |
draw_box = False
|
111 |
detection_model = "retinaface_resnet50"
|
112 |
print('Inp:', image, background_enhance, face_upsample, upscale, codeformer_fidelity)
|
|
|
|
|
|
|
|
|
|
|
113 |
|
114 |
img = cv2.imread(str(image), cv2.IMREAD_COLOR)
|
115 |
print('\timage size:', img.shape)
|
@@ -266,13 +271,13 @@ td {
|
|
266 |
|
267 |
demo = gr.Interface(
|
268 |
inference, [
|
269 |
-
gr.
|
270 |
-
gr.
|
271 |
-
gr.
|
272 |
-
gr.
|
273 |
gr.Slider(0, 1, value=0.5, step=0.01, label='Codeformer_Fidelity (0 for better quality, 1 for better identity)')
|
274 |
], [
|
275 |
-
gr.
|
276 |
],
|
277 |
title=title,
|
278 |
description=description,
|
@@ -283,8 +288,7 @@ demo = gr.Interface(
|
|
283 |
['03.jpg', True, True, 2, 0.7],
|
284 |
['04.jpg', True, True, 2, 0.1],
|
285 |
['05.jpg', True, True, 2, 0.1]
|
286 |
-
]
|
287 |
-
)
|
288 |
|
289 |
demo.queue(api_open=False, concurrency_count=2, max_size=10)
|
290 |
demo.launch()
|
|
|
110 |
draw_box = False
|
111 |
detection_model = "retinaface_resnet50"
|
112 |
print('Inp:', image, background_enhance, face_upsample, upscale, codeformer_fidelity)
|
113 |
+
|
114 |
+
if face_upsample is None:
|
115 |
+
face_upsample = False
|
116 |
+
if upscale is None:
|
117 |
+
upscale = False
|
118 |
|
119 |
img = cv2.imread(str(image), cv2.IMREAD_COLOR)
|
120 |
print('\timage size:', img.shape)
|
|
|
271 |
|
272 |
demo = gr.Interface(
|
273 |
inference, [
|
274 |
+
gr.Image(type="filepath", label="Input"),
|
275 |
+
gr.Checkbox(value=True, label="Background_Enhance"),
|
276 |
+
gr.Checkbox(value=True, label="Face_Upsample"),
|
277 |
+
gr.Number(value=2, label="Rescaling_Factor (up to 4)"),
|
278 |
gr.Slider(0, 1, value=0.5, step=0.01, label='Codeformer_Fidelity (0 for better quality, 1 for better identity)')
|
279 |
], [
|
280 |
+
gr.Image(type="numpy", label="Output")
|
281 |
],
|
282 |
title=title,
|
283 |
description=description,
|
|
|
288 |
['03.jpg', True, True, 2, 0.7],
|
289 |
['04.jpg', True, True, 2, 0.1],
|
290 |
['05.jpg', True, True, 2, 0.1]
|
291 |
+
])
|
|
|
292 |
|
293 |
demo.queue(api_open=False, concurrency_count=2, max_size=10)
|
294 |
demo.launch()
|