Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -528,8 +528,8 @@ def draw_mask(l, t, v, d, evt: gr.EventData):
|
|
528 |
|
529 |
indices = np.arange(0,256) # List of all colors
|
530 |
divider = np.linspace(0,255,l+1)[1] # we get a divider
|
531 |
-
quantiz = np.
|
532 |
-
color_levels = np.clip(np.
|
533 |
palette = quantiz[color_levels]
|
534 |
|
535 |
#for i in range(l):
|
|
|
528 |
|
529 |
indices = np.arange(0,256) # List of all colors
|
530 |
divider = np.linspace(0,255,l+1)[1] # we get a divider
|
531 |
+
quantiz = np.intp(np.linspace(0,255,l)) # we get quantization colors
|
532 |
+
color_levels = np.clip(np.intp(indices/divider),0,l-1) # color levels 0,1,2..
|
533 |
palette = quantiz[color_levels]
|
534 |
|
535 |
#for i in range(l):
|