dlup.viz package
Contents
dlup.viz package#
Submodules#
dlup.viz.plotting module#
- dlup.viz.plotting.plot_2d(image: PIL.Image.Image, mask: Optional[numpy.ndarray[Any, numpy.dtype[numpy.int64]]] = None, mask_colors: Optional[dict[int, str]] = None, mask_alpha: int = 70, geometries: Optional[list[dlup.annotations.Polygon | dlup.annotations.Point]] = None, geometries_color_map: Optional[dict[str, str]] = None) PIL.Image.Image [source]#
Plotting utility to overlay masks and geometries (Points, Polygons) on top of the image.
- Parameters
- imagePIL.Image
- masknp.ndarray
Integer array
- mask_colorsdict
A dictionary mapping the integer value of the mask to a PIL color value.
- mask_alphaint
Value between 0-100 defining the transparency of the overlays
- geometrieslist
List of Point or Polygon
- geometries_color_mapdict
Dictionary mapping label names to the PIL color value
- Returns
- PIL.Image