freealise commited on
Commit
e588d54
1 Parent(s): 610be69

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -360,6 +360,9 @@ def draw_mask(f, n, c, v, d, evt: gr.EventData):
360
  else:
361
  gradient = cv2.imread(f[2]).astype(np.uint8)
362
 
 
 
 
363
  #for i in range(n):
364
  # im[(im >= i*255/n) & (im < (i+1)*255/n)] = i*255/(n-1)
365
  indices = np.arange(0,256) # List of all colors
 
360
  else:
361
  gradient = cv2.imread(f[2]).astype(np.uint8)
362
 
363
+ if len(d["layers"]) == 1:
364
+ d["layers"][1] = d["layers"][0].copy()
365
+
366
  #for i in range(n):
367
  # im[(im >= i*255/n) & (im < (i+1)*255/n)] = i*255/(n-1)
368
  indices = np.arange(0,256) # List of all colors