Skip to content

Commit 0671594

Browse files
committed
predict iou
1 parent dcc39cf commit 0671594

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

darknet.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,17 @@ def _process_batch(data):
100100
np.ascontiguousarray(gt_boxes_resize, dtype=np.float)
101101
)
102102
anchor_inds = np.argmax(anchor_ious, axis=0)
103+
104+
ious_reshaped = np.reshape(ious, [hw, num_anchors, len(cell_inds)])
103105
for i, cell_ind in enumerate(cell_inds):
104106
if cell_ind >= hw or cell_ind < 0:
105107
print cell_ind
106108
continue
107109
a = anchor_inds[i]
108110

109111
_iou_mask[cell_ind, a, :] = cfg.object_scale
110-
_ious[cell_ind, a, :] = anchor_ious[a, i]
112+
# _ious[cell_ind, a, :] = anchor_ious[a, i]
113+
_ious[cell_ind, a, :] = ious_reshaped[cell_ind, a, i]
111114

112115
_box_mask[cell_ind, a, :] = cfg.coord_scale
113116
target_boxes[i, 2:4] /= anchors[a]

0 commit comments

Comments
 (0)