diff --git a/supervision/detection/core.py b/supervision/detection/core.py index 70eeac22..8ff5340c 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -71,11 +71,12 @@ class Detections: Optional[float], Optional[int], Optional[int], + Dict[str, Union[np.ndarray, List]], ] ]: """ Iterates over the Detections object and yield a tuple of - `(xyxy, mask, confidence, class_id, tracker_id)` for each detection. + `(xyxy, mask, confidence, class_id, tracker_id, data)` for each detection. """ for i in range(len(self.xyxy)): yield ( @@ -84,6 +85,7 @@ class Detections: self.confidence[i] if self.confidence is not None else None, self.class_id[i] if self.class_id is not None else None, self.tracker_id[i] if self.tracker_id is not None else None, + get_data_item(self.data, i), ) def __eq__(self, other: Detections):