freealise commited on
Commit
c627a14
1 Parent(s): fb6c22a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -576,6 +576,13 @@ def draw_mask(l, t, v, d, evt: gr.EventData):
576
  if len(edge) == 0 or params["fnum"] != frame_selected or params["l"] != l:
577
  if len(edge) > 0:
578
  d["background"] = cv2.imread(depths[frame_selected]).astype(np.uint8)
 
 
 
 
 
 
 
579
 
580
  bg = cv2.cvtColor(d["background"], cv2.COLOR_RGBA2GRAY)
581
 
 
576
  if len(edge) == 0 or params["fnum"] != frame_selected or params["l"] != l:
577
  if len(edge) > 0:
578
  d["background"] = cv2.imread(depths[frame_selected]).astype(np.uint8)
579
+
580
+ if d["background"].shape[0] == 2048: #height
581
+ gradient = cv2.imread('./gradient_large.png').astype(np.uint8)
582
+ elif d["background"].shape[0] == 1024:
583
+ gradient = cv2.imread('./gradient.png').astype(np.uint8)
584
+ else:
585
+ gradient = cv2.imread('./gradient_small.png').astype(np.uint8)
586
 
587
  bg = cv2.cvtColor(d["background"], cv2.COLOR_RGBA2GRAY)
588