Update app.py
Browse files
app.py
CHANGED
|
@@ -17,10 +17,10 @@ def predict(image):
|
|
| 17 |
width, height = image.size
|
| 18 |
ratio = width / height
|
| 19 |
if(width > height):
|
| 20 |
-
height = int(256
|
| 21 |
width = 256
|
| 22 |
else:
|
| 23 |
-
width = int(256
|
| 24 |
height = 256
|
| 25 |
|
| 26 |
image = TF.resize(image, (height, width))
|
|
@@ -54,4 +54,4 @@ iface = gr.Interface(
|
|
| 54 |
)
|
| 55 |
|
| 56 |
# Launch the interface
|
| 57 |
-
iface.launch(
|
|
|
|
| 17 |
width, height = image.size
|
| 18 |
ratio = width / height
|
| 19 |
if(width > height):
|
| 20 |
+
height = int(256 / ratio)
|
| 21 |
width = 256
|
| 22 |
else:
|
| 23 |
+
width = int(256 * ratio)
|
| 24 |
height = 256
|
| 25 |
|
| 26 |
image = TF.resize(image, (height, width))
|
|
|
|
| 54 |
)
|
| 55 |
|
| 56 |
# Launch the interface
|
| 57 |
+
iface.launch()
|