Загрузка
Draws segmentation masks on given RGB image. The image values should be uint8 in [0, 255] or float in [0, 1].
image (Tensor) – Tensor of shape (3, H, W) and dtype uint8 or float.
masks (Tensor) – Tensor of shape (num_masks, H, W) or (H, W) and dtype bool.
alpha (float) – Float number between 0 and 1 denoting the transparency of the masks. 0 means full transparency, 1 means no transparency.
colors (color or list of colors, optional) – List containing the colors
of the masks or single color for all masks. The color can be represented as
PIL strings e.g. “red” or “#FF00FF”, or as RGB tuples e.g. (240, 10, 157).
By default, random colors are generated for each mask.
Image Tensor, with segmentation masks drawn on top.
img (Tensor[C, H, W])
Examples using draw_segmentation_masks: