Update app.py
Browse files
app.py
CHANGED
@@ -557,7 +557,7 @@ def apply_mask(d,b):
|
|
557 |
mask = cv2.cvtColor(d["layers"][0], cv2.COLOR_RGBA2GRAY)
|
558 |
mask = (mask - 128).astype(np.uint8)
|
559 |
|
560 |
-
mask, bgdModel, fgdModel = cv2.grabCut(d["background"], mask, None,None,None,15, cv2.GC_INIT_WITH_MASK)
|
561 |
mask = np.where((mask==2)|(mask==0),1,0).astype('uint8')
|
562 |
|
563 |
frame = cv2.imread(frames[frame_selected], cv2.IMREAD_UNCHANGED).astype(np.uint8)
|
|
|
557 |
mask = cv2.cvtColor(d["layers"][0], cv2.COLOR_RGBA2GRAY)
|
558 |
mask = (mask - 128).astype(np.uint8)
|
559 |
|
560 |
+
mask, bgdModel, fgdModel = cv2.grabCut(cv2.cvtColor(d["background"], cv2.COLOR_RGBA2RGB), mask, None,None,None,15, cv2.GC_INIT_WITH_MASK)
|
561 |
mask = np.where((mask==2)|(mask==0),1,0).astype('uint8')
|
562 |
|
563 |
frame = cv2.imread(frames[frame_selected], cv2.IMREAD_UNCHANGED).astype(np.uint8)
|