Update app.py
Browse files18 unmodified lines19202122232425262716 unmodified lines44454647484918 unmodified linesif image is None:raise gr.Error("Image not uploaded")width, height = image.sizeif width >= 5000 or height >= 5000:raise gr.Error("The image is too large.")if torch.cuda.is_available():torch.cuda.empty_cache()16 unmodified linesresult = model2.predict(image.convert('RGB'))else:try:result = model8.predict(image.convert('RGB'))except torch.cuda.OutOfMemoryError as e:print(e)18 unmodified lines19202122232416 unmodified lines41424344454647484918 unmodified linesif image is None:raise gr.Error("Image not uploaded")if torch.cuda.is_available():torch.cuda.empty_cache()16 unmodified linesresult = model2.predict(image.convert('RGB'))else:try:width, height = image.sizeif width >= 5000 or height >= 5000:raise gr.Error("The image is too large.")result = model8.predict(image.convert('RGB'))except torch.cuda.OutOfMemoryError as e:print(e)
app.py+3-3