Spaces:
Sleeping
Sleeping
Update app.py
Browse files158 unmodified lines159160161162163164165166167168169170171172173158 unmodified linesupscale = 4if upscale > 2 and max(img.shape[:2])>1000: # avoid memory exceeded due to too large img resolutionupscale = 2if min(img.shape[:2]) > 1000 or max(img.shape[:2])>1500: # avoid memory exceeded due to too large img resolutionupscale = 1background_enhance = Falseif min(img.shape[:2]) > 1200 or max(img.shape[:2]) > 2000: # avoid memory exceeded due to too large img resolution# upscale = 1# background_enhance = False# face_upsample = Falseraise gr.Error("Image resolution is too large (short side > 1200 or long side > 2000). ""To keep the demo responsive and avoid long queue times, this case is skipped. ""For such inputs, please deploy this demo locally and remove this limit.")158 unmodified lines159160161162163164165166167168169170171172173158 unmodified linesupscale = 4if upscale > 2 and max(img.shape[:2])>1000: # avoid memory exceeded due to too large img resolutionupscale = 2if min(img.shape[:2]) > 1100 or max(img.shape[:2])>1500: # avoid memory exceeded due to too large img resolutionupscale = 1background_enhance = Falseface_upsample = Falseh, w = img.shape[:2]if h * w > 4_000_000: # avoid memory exceeded due to too large img resolutionraise gr.Error("Image resolution is too large (>4 megapixels). ""To keep the demo responsive and avoid long queue times, this case is skipped. ""For such inputs, please deploy this demo locally and remove this limit.")
app.py+6-6