Pash1986 commited on
Commit
0ed6129
·
verified ·
1 Parent(s): 6221036

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -57,7 +57,8 @@ def start_image_search(image, text):
57
  ## Alert the user to upload an image
58
  raise gr.Error("Please upload an image first, make sure to press the 'Submit' button after selecting the image.")
59
  buffered = io.BytesIO()
60
- image.save(buffered, format="JPEG")
 
61
  img_byte = buffered.getvalue()
62
  # Encode this byte array to Base64
63
  img_base64 = base64.b64encode(img_byte)
 
57
  ## Alert the user to upload an image
58
  raise gr.Error("Please upload an image first, make sure to press the 'Submit' button after selecting the image.")
59
  buffered = io.BytesIO()
60
+ image = image.resize((800, 600))
61
+ image.save(buffered, format="JPEG", quality=85)
62
  img_byte = buffered.getvalue()
63
  # Encode this byte array to Base64
64
  img_base64 = base64.b64encode(img_byte)