Skip to content

Commit

Permalink
Support point_labels 2, 3 (bbox left-top / right-bottom) in Prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed May 5, 2024
1 parent 4bab138 commit 609cbdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osam/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def validate_point_labels(cls, point_labels, values):
raise ValueError("point_labels must be 1-dimensional")
if "points" in values and point_labels.shape[0] != values["points"].shape[0]:
raise ValueError("point_labels must have the same number of rows as points")
if not set(np.unique(point_labels).tolist()).issubset({0, 1}):
raise ValueError("point_labels must contain only 0s and 1s")
if not set(np.unique(point_labels).tolist()).issubset({0, 1, 2, 3}):
raise ValueError("point_labels must contain only 0, 1, 2, or 3")
return point_labels

@pydantic.field_serializer("point_labels")
Expand Down

0 comments on commit 609cbdd

Please sign in to comment.