记代码中的一些小细节:
解码代码:
def decode_segmap(label_mask, dataset, plot=False):
"""Decode segmentation class labels into a color image
Args:
label_mask (np.ndarray): an (M,N) array of integer values denoting
the class label at each spatial location.
plot (bool, optional): whether to show the resulting color image
in a figure.
Returns:
(np.ndarray, optional): the resulting decoded color image.
"""
n_classes = 6
label_colours = get_mydata_labels()
r = label_mask.copy() # h x w
g = label_mask.copy() # h x w
b