Spaces:
Runtime error
Runtime error
SUBLIME
#33
by
thekiller
- opened
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: π
|
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: green
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version: 3.
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
|
|
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: green
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 3.1.7
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
app.py
CHANGED
|
@@ -62,10 +62,6 @@ def inference(img, version, scale):
|
|
| 62 |
img_mode = None
|
| 63 |
|
| 64 |
h, w = img.shape[0:2]
|
| 65 |
-
if h > 3500 or w > 3500:
|
| 66 |
-
print('too large size')
|
| 67 |
-
return None, None
|
| 68 |
-
|
| 69 |
if h < 300:
|
| 70 |
img = cv2.resize(img, (w * 2, h * 2), interpolation=cv2.INTER_LANCZOS4)
|
| 71 |
|
|
@@ -131,14 +127,14 @@ If you have any question, please email π§ `xintao.wang@outlook.com` or `xintao
|
|
| 131 |
"""
|
| 132 |
demo = gr.Interface(
|
| 133 |
inference, [
|
| 134 |
-
gr.Image(type="filepath", label="Input"),
|
| 135 |
-
# gr.Radio(['v1.2', 'v1.3', 'v1.4', 'RestoreFormer', 'CodeFormer'], type="value",
|
| 136 |
-
gr.Radio(['v1.2', 'v1.3', 'v1.4', 'RestoreFormer'], type="value",
|
| 137 |
-
gr.Number(label="Rescaling factor",
|
| 138 |
-
# gr.Slider(0, 100, label='Weight, only for CodeFormer. 0 for better quality, 100 for better identity',
|
| 139 |
], [
|
| 140 |
-
gr.Image(type="numpy", label="Output (The whole image)"),
|
| 141 |
-
gr.File(label="Download the output image")
|
| 142 |
],
|
| 143 |
title=title,
|
| 144 |
description=description,
|
|
@@ -147,4 +143,5 @@ demo = gr.Interface(
|
|
| 147 |
# ['10045.png', 'v1.4', 2, 50]]).launch()
|
| 148 |
examples=[['AI-generate.jpg', 'v1.4', 2], ['lincoln.jpg', 'v1.4', 2], ['Blake_Lively.jpg', 'v1.4', 2],
|
| 149 |
['10045.png', 'v1.4', 2]])
|
| 150 |
-
demo.queue()
|
|
|
|
|
|
| 62 |
img_mode = None
|
| 63 |
|
| 64 |
h, w = img.shape[0:2]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
if h < 300:
|
| 66 |
img = cv2.resize(img, (w * 2, h * 2), interpolation=cv2.INTER_LANCZOS4)
|
| 67 |
|
|
|
|
| 127 |
"""
|
| 128 |
demo = gr.Interface(
|
| 129 |
inference, [
|
| 130 |
+
gr.inputs.Image(type="filepath", label="Input"),
|
| 131 |
+
# gr.inputs.Radio(['v1.2', 'v1.3', 'v1.4', 'RestoreFormer', 'CodeFormer'], type="value", default='v1.4', label='version'),
|
| 132 |
+
gr.inputs.Radio(['v1.2', 'v1.3', 'v1.4', 'RestoreFormer'], type="value", default='v1.4', label='version'),
|
| 133 |
+
gr.inputs.Number(label="Rescaling factor", default=2),
|
| 134 |
+
# gr.Slider(0, 100, label='Weight, only for CodeFormer. 0 for better quality, 100 for better identity', default=50)
|
| 135 |
], [
|
| 136 |
+
gr.outputs.Image(type="numpy", label="Output (The whole image)"),
|
| 137 |
+
gr.outputs.File(label="Download the output image")
|
| 138 |
],
|
| 139 |
title=title,
|
| 140 |
description=description,
|
|
|
|
| 143 |
# ['10045.png', 'v1.4', 2, 50]]).launch()
|
| 144 |
examples=[['AI-generate.jpg', 'v1.4', 2], ['lincoln.jpg', 'v1.4', 2], ['Blake_Lively.jpg', 'v1.4', 2],
|
| 145 |
['10045.png', 'v1.4', 2]])
|
| 146 |
+
demo.queue(concurrency_count=4)
|
| 147 |
+
demo.launch()
|