iaa_od.palette

iaa_od.palette.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.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]

iaa_od.palette.to_rgba(color, /, *, alpha=1.0)[source]

Converts an RGB color tuple to an RGBA color tuple with the specified alpha value (1.0 by default).

Parameters:
  • color (tuple[int, int, int]) – A tuple representing the RGB color (R, G, B) with values in the range 0-255.

  • alpha (float) – The alpha value for the RGBA color, ranging from 0.0 (fully transparent) to 1.0 (fully opaque).

Returns:

A tuple representing the RGBA color (R, G, B, A) with values in the range 0.0-1.0.

Return type:

tuple[float, float, float, float]

Modules

category_to_color

to_rgba(color, /, *[, alpha])

Converts an RGB color tuple to an RGBA color tuple with the specified alpha value (1.0 by default).