Spaces:
Runtime error
Runtime error
lkeab
commited on
Commit
·
84ef148
1
Parent(s):
ea9dbee
update app limit
Browse files
app.py
CHANGED
|
@@ -37,7 +37,13 @@ predictor = DefaultPredictor(cfg)
|
|
| 37 |
|
| 38 |
|
| 39 |
def inference(image):
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
img = np.asarray(image)
|
| 42 |
|
| 43 |
#img = np.array(image)
|
|
|
|
| 37 |
|
| 38 |
|
| 39 |
def inference(image):
|
| 40 |
+
width, height = image.size
|
| 41 |
+
if width > 1300:
|
| 42 |
+
ratio = float(height) / float(width)
|
| 43 |
+
width = 1300
|
| 44 |
+
height = int(ratio * width)
|
| 45 |
+
image = image.resize((width, height))
|
| 46 |
+
|
| 47 |
img = np.asarray(image)
|
| 48 |
|
| 49 |
#img = np.array(image)
|