Spaces:
Running
on
L4
Running
on
L4
Update app.py
Browse files
app.py
CHANGED
|
@@ -159,12 +159,15 @@ def inference(image, face_align, background_enhance, face_upsample, upscale, cod
|
|
| 159 |
upscale = 4
|
| 160 |
if upscale > 2 and max(img.shape[:2])>1000: # avoid memory exceeded due to too large img resolution
|
| 161 |
upscale = 2
|
| 162 |
-
if min(img.shape[:2]) >
|
|
|
|
|
|
|
|
|
|
| 163 |
# upscale = 1
|
| 164 |
# background_enhance = False
|
| 165 |
# face_upsample = False
|
| 166 |
raise gr.Error(
|
| 167 |
-
"Image resolution is too large (short side >
|
| 168 |
"To keep the demo responsive and avoid long queue times, this case is skipped. "
|
| 169 |
"For such inputs, please deploy this demo locally and remove this limit."
|
| 170 |
)
|
|
|
|
| 159 |
upscale = 4
|
| 160 |
if upscale > 2 and max(img.shape[:2])>1000: # avoid memory exceeded due to too large img resolution
|
| 161 |
upscale = 2
|
| 162 |
+
if min(img.shape[:2]) > 1000 or max(img.shape[:2])>1500: # avoid memory exceeded due to too large img resolution
|
| 163 |
+
upscale = 1
|
| 164 |
+
background_enhance = False
|
| 165 |
+
if min(img.shape[:2]) > 1200 or max(img.shape[:2]) > 2000: # avoid memory exceeded due to too large img resolution
|
| 166 |
# upscale = 1
|
| 167 |
# background_enhance = False
|
| 168 |
# face_upsample = False
|
| 169 |
raise gr.Error(
|
| 170 |
+
"Image resolution is too large (short side > 1200 or long side > 2000). "
|
| 171 |
"To keep the demo responsive and avoid long queue times, this case is skipped. "
|
| 172 |
"For such inputs, please deploy this demo locally and remove this limit."
|
| 173 |
)
|