|
|
@ -90,12 +90,12 @@ def det_postprocess(data: Tuple[ndarray, ndarray, ndarray, ndarray]): |
|
|
|
assert len(data) == 4 |
|
|
|
assert len(data) == 4 |
|
|
|
iou_thres: float = 0.65 |
|
|
|
iou_thres: float = 0.65 |
|
|
|
num_dets, bboxes, scores, labels = (i[0] for i in data) |
|
|
|
num_dets, bboxes, scores, labels = (i[0] for i in data) |
|
|
|
# check score negative |
|
|
|
|
|
|
|
scores[scores < 0] = 1 + scores[scores < 0] |
|
|
|
|
|
|
|
nums = num_dets.item() |
|
|
|
nums = num_dets.item() |
|
|
|
if nums == 0: |
|
|
|
if nums == 0: |
|
|
|
return np.empty((0, 4), dtype=np.float32), np.empty( |
|
|
|
return np.empty((0, 4), dtype=np.float32), np.empty( |
|
|
|
(0, ), dtype=np.float32), np.empty((0, ), dtype=np.int32) |
|
|
|
(0, ), dtype=np.float32), np.empty((0, ), dtype=np.int32) |
|
|
|
|
|
|
|
# check score negative |
|
|
|
|
|
|
|
scores[scores < 0] = 1 + scores[scores < 0] |
|
|
|
# add nms |
|
|
|
# add nms |
|
|
|
idx = nms(bboxes, scores, iou_thres) |
|
|
|
idx = nms(bboxes, scores, iou_thres) |
|
|
|
bboxes, scores, labels = bboxes[idx], scores[idx], labels[idx] |
|
|
|
bboxes, scores, labels = bboxes[idx], scores[idx], labels[idx] |
|
|
|