Skip to content

Commit

Permalink
Normalize detections. (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkeroo authored Aug 30, 2024
1 parent 9b4aff5 commit 07923a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions depthai_nodes/ml/parsers/utils/scrfd.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,11 @@ def decode_scrfd(
kpss = kpss[order, :, :]
kpss = kpss[keep, :, :]

height, width = input_size
scores = det[:, 4]
bboxes = np.int32(det[:, :4])
keypoints = np.int32(kpss)
bboxes = det[:, :4] / np.array([width, height] * 2)

keypoints = kpss / np.tile([width, height], (5, 1))
keypoints = keypoints.reshape(-1, 5, 2)

return bboxes, scores, keypoints

0 comments on commit 07923a1

Please sign in to comment.