ai_engine/utils/visualization_utils.py
def create_alphablend(
    img: np.array,
    mask: np.array,
    alpha: float,
    colors_dict: dict,
    class2label: Union[None, Dict[int, str]] = None,
) -> np.array:
    """A method to create alphablend image

    Args:
        img (np.array): Input image
        mask (np.array): Mask
        alpha (float): Alpha value
        colors_dict (dict): Dictionary matching class id to color
        class2label (dict): Dictionary matching class id to label

    Returns:
        np.array: Alphablend image
    """

    for class_int, color in colors_dict.items():
        class_mask = np.where(mask == class_int, 1, 0)
        img = apply_single_mask(img, class_mask, color, alpha)

    return img
A method to create alphablend image

    Args:
        img (np.array): Input image
        mask (np.array): Mask
        alpha (float): Alpha value
        colors_dict (dict): Dictionary matching class id to color
        class2label (dict): Dictionary matching class id to label

    Returns:
        np.array: Alphablend image
    
A method to create alphablend image
A method to create alphablend image
def create_alphablend(
    img: np.array,
    mask: np.array,
    alpha: float,
    colors_dict: dict,
    class2label: Union[None, Dict[int, str]] = None,
) -> np.array:
    for class_int, color in colors_dict.items():
        class_mask = np.where(mask == class_int, 1, 0)
        img = apply_single_mask(img, class_mask, color, alpha)
    return img
def create_alphablend ( img : np . array , mask : np . array , alpha : float , colors_dict : dict , class2label : Union [ None , Dict [ int , str ] ] = None , ) -> np . array : for class_int , color in colors_dict . items ( ) : class_mask = np . where ( mask == class_int , 1 , 0 ) img = apply_single_mask ( img , class_mask , color , alpha ) return img
A method to create alphablend image
A method to create alphablend image
"""A method to create alphablend image

    Args:
        img (np.array): Input image
        mask (np.array): Mask
        alpha (float): Alpha value
        colors_dict (dict): Dictionary matching class id to color
        class2label (dict): Dictionary matching class id to label

    Returns:
        np.array: Alphablend image
    """
None
np.array
img
np.array
None
mask
np.array
None
alpha
float
None
colors_dict
dict
Dictionary matching class id to color
Dictionary matching class id to color
class2label
Union[None, Dict[int, str]]
Dictionary matching class id to label
Dictionary matching class id to label