visualize.py
def apply_parsing(image, part, color_map, alpha=0.7):
    """Apply the given parsing to the image.
    """
    assert image.shape[0] == part.shape[0] and image.shape[1] == part.shape[1]
    coordinates = np.where(part > 0)
    for i in range(len(coordinates[0])):
        image[coordinates[0][i], coordinates[1][i], :] = color_map[part[coordinates[0][i], coordinates[1][i]]] * alpha + image[coordinates[0][i], coordinates[1][i], :] * (1 - alpha)
    return image
Apply the given parsing to the image.
    
Apply the given parsing to the image.
Apply the given parsing to the image .
def apply_parsing(image, part, color_map, alpha=0.7):
    assert image.shape[0] == part.shape[0] and image.shape[1] == part.shape[1]
    coordinates = np.where(part > 0)
    for i in range(len(coordinates[0])):
        image[coordinates[0][i], coordinates[1][i], :] = color_map[part[coordinates[0][i], coordinates[1][i]]] * alpha + image[coordinates[0][i], coordinates[1][i], :] * (1 - alpha)
    return image
def apply_parsing ( image , part , color_map , alpha = 0.7 ) : assert image . shape [ 0 ] == part . shape [ 0 ] and image . shape [ 1 ] == part . shape [ 1 ] coordinates = np . where ( part > 0 ) for i in range ( len ( coordinates [ 0 ] ) ) : image [ coordinates [ 0 ] [ i ] , coordinates [ 1 ] [ i ] , : ] = color_map [ part [ coordinates [ 0 ] [ i ] , coordinates [ 1 ] [ i ] ] ] * alpha + image [ coordinates [ 0 ] [ i ] , coordinates [ 1 ] [ i ] , : ] * ( 1 - alpha ) return image
Apply the given parsing to the image.
Apply the given parsing to the image .
"""Apply the given parsing to the image.
    """
image
part
color_map
alpha