def seg2rgb(seg, palette, n_segmentation_classes):
    """Color each pixel by segmentation class.

	Parameters
	----------
	seg:array
		Segmentation mask.
	palette:palette
		Color to RGB map.
	n_segmentation_classes:int
		Total number segmentation classes.

	Returns
	-------
	array
		Returned segmentation image.
	"""
    img = (palette(seg / n_segmentation_classes)[(...), :3] * 255).astype(int)
    return img
