sczhou commited on
Commit
dd797d1
·
verified ·
1 Parent(s): 3f34ef1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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]) > 1100 or max(img.shape[:2]) > 1500: # avoid memory exceeded due to too large img resolution
 
 
 
163
  # upscale = 1
164
  # background_enhance = False
165
  # face_upsample = False
166
  raise gr.Error(
167
- "Image resolution is too large (short side > 1100 or long side > 1500). "
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
  )