Spaces:
Runtime error
Runtime error
Update app.py
Browse files29 unmodified lines3031323334353637383940414243444529 unmodified linesdef inference(img,task):os.system('mkdir temp')max_res = 904width, height = img.sizeif max(width,height) > max_res:scale = min(width,height)/max(width,height)if width > max_res:width = max_resheight = int(scale*max_res)if height > max_res:height = max_reswidth = int(scale*max_res)img = img.resize((width,height), Image.ANTIALIAS)img.save("temp/image.jpg", "JPEG")29 unmodified lines303132333435363738394041424329 unmodified linesdef inference(img,task):os.system('mkdir temp')# Resize the longer edge of the input imagemax_res = 512width, height = img.sizeif max(width,height) > max_res:scale = max_res /max(width,height)width = int(scale*width)height = int(scale*height)img = img.resize((width,height), Image.ANTIALIAS)img.save("temp/image.jpg", "JPEG")
app.py+6-8