Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix validation in cluster creation. #150

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions depthai_nodes/ml/messages/creators/clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def create_cluster_message(clusters: List[List[List[Union[float, int]]]]) -> Clu
if not isinstance(cluster, list):
raise TypeError(f"All clusters must be of type List, got {type(cluster)}")
for point in cluster:
if not isinstance(point, list):
if not isinstance(point, tuple) and not isinstance(point, list):
raise TypeError(
f"All points in clusters must be of type List, got {type(point)}"
f"All points in clusters must be of type tuple or list, got {type(point)}"
)
if len(point) != 2:
raise ValueError(f"Each point must have 2 values, got {len(point)}")
Expand Down
Loading