Skip to content

Better handling of wrong data types of mask for sv.PolygonZone() #106

Closed
@GeorgePearse

Description

@GeorgePearse

Search before asking

  • I have searched the Supervision issues and found no similar feature requests.

Description

image

OpenCV errors out with an uninformative error when the dtype of the mask is wrong.

Would be good to add catch if dtype != np.int32 and raise an Exception.

Use case

I was trying to create a mask in CVAT, the exported segmentation had decimal places, np.array(coords) did not convert to np.int32, and I was confused by the bad error message.

This is likely to happen to other users too .

Additional

Happy to submit PR

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestversion: 0.9.0Feature to be added in `0.9.0` release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions