Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,6 @@ def nms(final_boxes, scores, IOU_threshold=0):
|
|
20 |
|
21 |
boxes = [list(map(int, i)) for i in boxes]
|
22 |
boxes = np.array(boxes)
|
23 |
-
#print(boxes)
|
24 |
|
25 |
x1 = boxes[:, 0]
|
26 |
y1 = boxes[:, 1]
|
@@ -31,7 +30,6 @@ def nms(final_boxes, scores, IOU_threshold=0):
|
|
31 |
area = (x2 - x1)*(y2 - y1)
|
32 |
|
33 |
order = np.argsort(scores)
|
34 |
-
#print(order)
|
35 |
|
36 |
pick = []
|
37 |
|
@@ -73,11 +71,9 @@ def detect_obj(input_image):
|
|
73 |
|
74 |
image = image.astype(np.float32)
|
75 |
image = np.expand_dims(image, axis=0)
|
76 |
-
print(image.shape)
|
77 |
|
78 |
output = m.run(['reshape'], {"input": image})
|
79 |
output = np.squeeze(output, axis=0)
|
80 |
-
print(output.shape)
|
81 |
|
82 |
THRESH=.25
|
83 |
|
@@ -122,7 +118,6 @@ def detect_obj(input_image):
|
|
122 |
|
123 |
nms_output = nms(final_boxes, final_scores, 0.3)
|
124 |
|
125 |
-
print(nms_output)
|
126 |
for i in nms_output:
|
127 |
cv2.rectangle(
|
128 |
img,
|
|
|
20 |
|
21 |
boxes = [list(map(int, i)) for i in boxes]
|
22 |
boxes = np.array(boxes)
|
|
|
23 |
|
24 |
x1 = boxes[:, 0]
|
25 |
y1 = boxes[:, 1]
|
|
|
30 |
area = (x2 - x1)*(y2 - y1)
|
31 |
|
32 |
order = np.argsort(scores)
|
|
|
33 |
|
34 |
pick = []
|
35 |
|
|
|
71 |
|
72 |
image = image.astype(np.float32)
|
73 |
image = np.expand_dims(image, axis=0)
|
|
|
74 |
|
75 |
output = m.run(['reshape'], {"input": image})
|
76 |
output = np.squeeze(output, axis=0)
|
|
|
77 |
|
78 |
THRESH=.25
|
79 |
|
|
|
118 |
|
119 |
nms_output = nms(final_boxes, final_scores, 0.3)
|
120 |
|
|
|
121 |
for i in nms_output:
|
122 |
cv2.rectangle(
|
123 |
img,
|