Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -15,8 +15,8 @@ def encode_image(image_path):
|
|
15 |
# Open the image file
|
16 |
image = Image.open(image_path).convert("RGB")
|
17 |
|
18 |
-
# Resize the image to a height of
|
19 |
-
base_height =
|
20 |
h_percent = (base_height / float(image.size[1]))
|
21 |
w_size = int((float(image.size[0]) * float(h_percent)))
|
22 |
image = image.resize((w_size, base_height), Image.ANTIALIAS)
|
|
|
15 |
# Open the image file
|
16 |
image = Image.open(image_path).convert("RGB")
|
17 |
|
18 |
+
# Resize the image to a height of 512 while maintaining the aspect ratio
|
19 |
+
base_height = 512
|
20 |
h_percent = (base_height / float(image.size[1]))
|
21 |
w_size = int((float(image.size[0]) * float(h_percent)))
|
22 |
image = image.resize((w_size, base_height), Image.ANTIALIAS)
|