Spaces:
Runtime error
Runtime error
vahidrezanezhad
commited on
Commit
•
6bdbb2a
1
Parent(s):
aaa7157
Update app.py
Browse files
app.py
CHANGED
@@ -214,13 +214,13 @@ def do_prediction(model_name, img):
|
|
214 |
if x <= 30:
|
215 |
w += x
|
216 |
x = 0
|
217 |
-
if (
|
218 |
-
w = w + (
|
219 |
if y <= 30:
|
220 |
h = h + y
|
221 |
y = 0
|
222 |
-
if (
|
223 |
-
h = h + (
|
224 |
|
225 |
box = [x, y, w, h]
|
226 |
|
|
|
214 |
if x <= 30:
|
215 |
w += x
|
216 |
x = 0
|
217 |
+
if (img_org.shape[1] - (x + w)) <= 30:
|
218 |
+
w = w + (img_org.shape[1] - (x + w))
|
219 |
if y <= 30:
|
220 |
h = h + y
|
221 |
y = 0
|
222 |
+
if (img_org.shape[0] - (y + h)) <= 30:
|
223 |
+
h = h + (img_org.shape[0] - (y + h))
|
224 |
|
225 |
box = [x, y, w, h]
|
226 |
|