Update app.py
Browse files
app.py
CHANGED
|
@@ -47,18 +47,18 @@ def resize_image_dimensions(
|
|
| 47 |
# height = height - (height % 32)
|
| 48 |
# return width, height
|
| 49 |
|
| 50 |
-
if width > height:
|
| 51 |
-
|
| 52 |
-
else:
|
| 53 |
-
|
| 54 |
|
| 55 |
-
new_width = int(width * scaling_factor)
|
| 56 |
-
new_height = int(height * scaling_factor)
|
| 57 |
|
| 58 |
-
new_width = new_width - (new_width % 32)
|
| 59 |
-
new_height = new_height - (new_height % 32)
|
| 60 |
|
| 61 |
-
return
|
| 62 |
|
| 63 |
|
| 64 |
@spaces.GPU(duration=80)
|
|
|
|
| 47 |
# height = height - (height % 32)
|
| 48 |
# return width, height
|
| 49 |
|
| 50 |
+
# if width > height:
|
| 51 |
+
# scaling_factor = maximum_dimension / width
|
| 52 |
+
# else:
|
| 53 |
+
# scaling_factor = maximum_dimension / height
|
| 54 |
|
| 55 |
+
# new_width = int(width * scaling_factor)
|
| 56 |
+
# new_height = int(height * scaling_factor)
|
| 57 |
|
| 58 |
+
# new_width = new_width - (new_width % 32)
|
| 59 |
+
# new_height = new_height - (new_height % 32)
|
| 60 |
|
| 61 |
+
return width, height
|
| 62 |
|
| 63 |
|
| 64 |
@spaces.GPU(duration=80)
|