iaa_od.palette.category_to_color

Functions

colormap_to_color(colormap, categories_dict)

Maps each category ID to a unique RGBA color using a provided colormap.

colormap_to_macrocat_color(colormap, ...)

Maps each macro-category name to a unique RGBA color using a provided colormap.

iaa_od.palette.category_to_color.colormap_to_color(colormap, categories_dict)[source]

Maps each category ID to a unique RGBA color using a provided colormap.

Parameters:
  • colormap (matplotlib.colors.Colormap) – A Matplotlib colormap to use for color mapping.

  • categories_dict (dict[int, str]) – A dictionary mapping category IDs to category names.

Returns:

A dictionary mapping category IDs to RGBA colors.

Return type:

dict[int, BoundingBoxColors]

iaa_od.palette.category_to_color.colormap_to_macrocat_color(colormap, macrocat_dict)[source]

Maps each macro-category name to a unique RGBA color using a provided colormap.

Parameters:
  • colormap (matplotlib.colors.Colormap) – A Matplotlib colormap to use for color mapping.

  • macrocat_dict (dict[str, list[int]]) – A dictionary mapping macro-category names to category IDs.

Returns:

A dictionary mapping category IDs to RGBA colors.

Return type:

dict[int, BoundingBoxColors]