clip-dinoiser / visualization.py
ariG23498's picture
ariG23498 HF staff
check
d2ff88f
raw
history blame contribute delete
206 Bytes
import numpy as np
def mask2rgb(mask, palette):
img = np.zeros((mask.shape[0], mask.shape[1], 3))
for l in np.unique(mask):
img[mask == int(l)] = palette[int(l)]
return img.astype(int)