Skip to content

Commit

Permalink
Fix validation in cluster creation. (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkeroo authored Dec 11, 2024
1 parent eb29bc7 commit 7cba004
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 7cba004

Please sign in to comment.