freealise commited on
Commit
aac5fb3
1 Parent(s): 4ab90c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -382,8 +382,8 @@ def draw_mask(l, c, k, v, d, evt: gr.EventData):
382
  delta = 0
383
  ddepth = cv2.CV_16S
384
 
385
- if edge == [] or params["fnum"] != frame_selected or params["l"] != l or params["c"] != c or params["k"] != k:
386
- if edge != []:
387
  d["background"] = cv2.imread(masks[frame_selected]).astype(np.uint8)
388
 
389
  bg = cv2.cvtColor(d["background"], cv2.COLOR_RGBA2GRAY)
 
382
  delta = 0
383
  ddepth = cv2.CV_16S
384
 
385
+ if len(edge) == 0 or params["fnum"] != frame_selected or params["l"] != l or params["c"] != c or params["k"] != k:
386
+ if len(edge) > 0:
387
  d["background"] = cv2.imread(masks[frame_selected]).astype(np.uint8)
388
 
389
  bg = cv2.cvtColor(d["background"], cv2.COLOR_RGBA2GRAY)