Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,7 @@ encoder2name = {
|
|
38 |
blurin = "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"
|
39 |
edge = []
|
40 |
gradient = None
|
41 |
-
params = { "fnum":0
|
42 |
dcolor = []
|
43 |
pcolors = []
|
44 |
frame_selected = 0
|
@@ -578,7 +578,7 @@ def draw_mask(o, b, v, d, evt: gr.EventData):
|
|
578 |
pts = np.array(points, np.int32)
|
579 |
pts = pts.reshape((-1,1,2))
|
580 |
|
581 |
-
if len(edge) == 0 or params["fnum"] != frame_selected
|
582 |
if len(edge) > 0:
|
583 |
d["background"] = cv2.imread(depths[frame_selected]).astype(np.uint8)
|
584 |
|
@@ -586,7 +586,6 @@ def draw_mask(o, b, v, d, evt: gr.EventData):
|
|
586 |
bg[bg==255] = 0
|
587 |
|
588 |
params["fnum"] = frame_selected
|
589 |
-
params["l"] = l
|
590 |
|
591 |
edge = bg.copy()
|
592 |
else:
|
|
|
38 |
blurin = "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"
|
39 |
edge = []
|
40 |
gradient = None
|
41 |
+
params = { "fnum":0 }
|
42 |
dcolor = []
|
43 |
pcolors = []
|
44 |
frame_selected = 0
|
|
|
578 |
pts = np.array(points, np.int32)
|
579 |
pts = pts.reshape((-1,1,2))
|
580 |
|
581 |
+
if len(edge) == 0 or params["fnum"] != frame_selected:
|
582 |
if len(edge) > 0:
|
583 |
d["background"] = cv2.imread(depths[frame_selected]).astype(np.uint8)
|
584 |
|
|
|
586 |
bg[bg==255] = 0
|
587 |
|
588 |
params["fnum"] = frame_selected
|
|
|
589 |
|
590 |
edge = bg.copy()
|
591 |
else:
|