small fix :)

This commit is contained in:
SkalskiP 2023-04-09 22:16:12 +02:00
parent bcc4b25eb9
commit 5b9eef363d
1 changed files with 5 additions and 1 deletions

View File

@ -17,7 +17,7 @@ def _validate_xyxy(xyxy: Any, n: int) -> None:
def _validate_mask(mask: Any, n: int) -> None:
is_valid = mask is None or (
isinstance(mask, np.ndarray) and len(mask.shape) == 3 and mask[0] == n
isinstance(mask, np.ndarray) and len(mask.shape) == 3 and mask.shape[0] == n
)
if not is_valid:
raise ValueError("mask must be 3d np.ndarray with (n, W, H) shape")
@ -239,6 +239,10 @@ class Detections:
class_id=np.array(class_id).astype(int),
)
@classmethod
def from_segment_anything_model(cls, segment_anything_model_result: List[dict]) -> Detections:
pass
@classmethod
def from_coco_annotations(cls, coco_annotation: dict) -> Detections:
xyxy, class_id = [], []