Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
ariG23498
/
clip-dinoiser
like
1
Sleeping
App
Files
Files
Community
9199a4f
clip-dinoiser
/
visualization.py
ariG23498
HF staff
check
d2ff88f
about 1 year ago
raw
Copy download link
history
blame
Safe
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
)