Skip to content

Commit 5871ca1

Browse files
Merge branch 'main' into fix/correlation-id-env-typo
2 parents b2d9ed9 + d72e089 commit 5871ca1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • inference/core/workflows/core_steps/fusion/detections_consensus

inference/core/workflows/core_steps/fusion/detections_consensus/v1.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,11 @@ def get_class_of_least_confident_detection(
576576

577577

578578
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))
579+
if len(detections) == 0:
580+
return (0.0, 0.0, 0.0, 0.0)
581+
582+
avg_xyxy = np.mean(detections.xyxy, axis=0)
583+
return tuple(avg_xyxy)
581584

582585

583586
def get_smallest_bounding_box(detections: sv.Detections) -> Tuple[int, int, int, int]:

0 commit comments

Comments
 (0)