Spaces:
Sleeping
Sleeping
Commit
·
a4a6781
1
Parent(s):
e4146f7
Update app.py
Browse files
app.py
CHANGED
|
@@ -186,11 +186,11 @@ with gr.Blocks() as demo:
|
|
| 186 |
for i in range(3):
|
| 187 |
batch_size, A, S, _, _ = test_img_out[i].shape # 1, anchors = 3, scaling = 13/26/52
|
| 188 |
anchor = anchors[i]
|
| 189 |
-
boxes_scale_i =
|
| 190 |
for idx, (box) in enumerate(boxes_scale_i):
|
| 191 |
bboxes[idx] += box
|
| 192 |
# nms
|
| 193 |
-
nms_boxes =
|
| 194 |
|
| 195 |
# use gradio image annotations
|
| 196 |
height, width = 416, 416
|
|
|
|
| 186 |
for i in range(3):
|
| 187 |
batch_size, A, S, _, _ = test_img_out[i].shape # 1, anchors = 3, scaling = 13/26/52
|
| 188 |
anchor = anchors[i]
|
| 189 |
+
boxes_scale_i = utils.cells_to_bboxes(test_img_out[i], anchor, S=S, is_preds=True)
|
| 190 |
for idx, (box) in enumerate(boxes_scale_i):
|
| 191 |
bboxes[idx] += box
|
| 192 |
# nms
|
| 193 |
+
nms_boxes = utils.non_max_suppression(bboxes[0], iou_threshold=0.6, threshold=0.5, box_format="midpoint",)
|
| 194 |
|
| 195 |
# use gradio image annotations
|
| 196 |
height, width = 416, 416
|