Utils
generate_2d_mask
Generate a 2D mask from a polygon.
Properties
polygon (np.ndarray): The polygon for which the mask should be generated, given as a list of vertices. resolution_wh (Tuple[int, int]): The width and height of the desired resolution.
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: The generated 2D mask, where the polygon is marked with |
Source code in supervision/detection/utils.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|