🫵 allow integer array indexing

This commit is contained in:
SkalskiP 2023-02-27 11:43:01 +01:00
parent 3ea95b3966
commit ba732330a5
1 changed files with 1 additions and 1 deletions

View File

@ -186,7 +186,7 @@ class Detections:
raise ValueError(f"{anchor} is not supported.")
def __getitem__(self, index: np.ndarray) -> Detections:
if isinstance(index, np.ndarray) and index.dtype == bool:
if isinstance(index, np.ndarray) and (index.dtype == bool or index.dtype == int):
return Detections(
xyxy=self.xyxy[index],
confidence=self.confidence[index],