freealise commited on
Commit
1494e64
1 Parent(s): 2a6e4d8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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.int0(np.linspace(0,255,l)) # we get quantization colors
532
- color_levels = np.clip(np.int0(indices/divider),0,l-1) # color levels 0,1,2..
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):