We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b2d9ed9 + d72e089 commit 5871ca1Copy full SHA for 5871ca1
1 file changed
inference/core/workflows/core_steps/fusion/detections_consensus/v1.py
@@ -576,8 +576,11 @@ def get_class_of_least_confident_detection(
576
577
578
def get_average_bounding_box(detections: sv.Detections) -> Tuple[int, int, int, int]:
579
- avg_xyxy: np.ndarray = sum(detections.xyxy) / len(detections)
580
- return tuple(avg_xyxy.astype(float))
+ if len(detections) == 0:
+ return (0.0, 0.0, 0.0, 0.0)
581
+
582
+ avg_xyxy = np.mean(detections.xyxy, axis=0)
583
+ return tuple(avg_xyxy)
584
585
586
def get_smallest_bounding_box(detections: sv.Detections) -> Tuple[int, int, int, int]:
0 commit comments