We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 00f2731 + c6f6996 commit 70cd538Copy full SHA for 70cd538
inference/core/workflows/core_steps/common/query_language/operations/detections/base.py
@@ -115,10 +115,10 @@ def select_top_confidence_detection(detections: sv.Detections) -> sv.Detections:
115
116
def select_leftmost_detection(detections: sv.Detections) -> sv.Detections:
117
if len(detections) == 0:
118
- return deepcopy(detections)
+ return detections # Directly return the original empty detections if empty
119
+
120
centers_x = detections.get_anchors_coordinates(anchor=Position.CENTER)[:, 0]
- min_value = centers_x.min()
121
- index = np.argwhere(centers_x == min_value)[0].item()
+ index = np.argmin(centers_x)
122
return detections[index]
123
124
0 commit comments