draw_segmentation_masks — Torchvision 0.22 documentation (original) (raw)

torchvision.utils.draw_segmentation_masks(image: Tensor, masks: Tensor, alpha: float = 0.8, colors: Optional[Union[List[Union[str, Tuple[int, int, int]]], str, Tuple[int, int, int]]] = None) → Tensor[source]

Draws segmentation masks on given RGB image. The image values should be uint8 in [0, 255] or float in [0, 1].

Parameters:

Returns:

Image Tensor, with segmentation masks drawn on top.

Return type:

img (Tensor[C, H, W])

Examples using draw_segmentation_masks: