Skip to content

Commit

Permalink
Better error in MPPalmDetectionParser. (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkeroo authored Sep 19, 2024
1 parent 7345faa commit 59a0190
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions depthai_nodes/ml/parsers/utils/medipipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,13 @@ def decode_bboxes(score_thresh, scores, bboxes, anchors, scale=128, best_only=Fa
det_scores = scores[detection_mask]
if det_scores.size == 0:
return regions
try:
det_bboxes2 = bboxes[detection_mask]
det_anchors = anchors[detection_mask]
except Exception as e:
raise IndexError(
"Wrong parser scale set. Please use setScale method to set different scale according to model dimensions (e.g. 128)."
) from e

det_bboxes = det_bboxes2 * np.tile(det_anchors[:, 2:4], 9) / scale + np.tile(
det_anchors[:, 0:2], 9
Expand Down

0 comments on commit 59a0190

Please sign in to comment.