src/maskrcnn/model.py
def compute_colors_for_labels(
    labels, palette=torch.tensor([2 ** 25 - 1, 2 ** 15 - 1, 2 ** 21 - 1])
):
    """
    Simple function that adds fixed colors depending on the class
    """
    colors = labels[:, None] * palette
    colors = (colors % 255).numpy().astype("uint8")
    return colors

    Simple function that adds fixed colors depending on the class
    
Simple function that adds fixed colors depending on the class
Simple function that adds fixed colors depending on the class
def compute_colors_for_labels(
    labels, palette=torch.tensor([2 ** 25 - 1, 2 ** 15 - 1, 2 ** 21 - 1])
):
    colors = labels[:, None] * palette
    colors = (colors % 255).numpy().astype("uint8")
    return colors
def compute_colors_for_labels ( labels , palette = torch . tensor ( [ 2 ** 25 - 1 , 2 ** 15 - 1 , 2 ** 21 - 1 ] ) ) : colors = labels [ : , None ] * palette colors = ( colors % 255 ) . numpy ( ) . astype ( "uint8" ) return colors
Simple function that adds fixed colors depending on the class
Simple function that adds fixed colors depending on the class
"""
    Simple function that adds fixed colors depending on the class
    """
labels
palette