reproduce step:
python main.py -f ~/Downloads/final_demo_data/test1.mp4 -fg=grabcut
result:
Extracting foreground...
0%| | 0/404 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/Users/chinlung/workspace/panoramaProject/main.py", line 103, in
main(args)
File "/Users/chinlung/workspace/panoramaProject/main.py", line 51, in main
fg, bg, fgmasks = cap.extract_foreground(config.fgmode, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/chinlung/workspace/panoramaProject/panorama/video.py", line 145, in extract_foreground
fgmasks = extractor.get_foreground_mask_grabcut(frames)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/chinlung/workspace/panoramaProject/panorama/foreground_extraction.py", line 20, in get_foreground_mask_grabcut
cv2.grabCut(frame, fgmask, rect, bgdModel, fgdModel, 5,
cv2.error: OpenCV(4.6.0) /Users/xperience/actions-runner/_work/opencv-python/opencv-python/opencv/modules/imgproc/src/grabcut.cpp:386: error: (-215:Assertion failed) !bgdSamples.empty() && !fgdSamples.empty() in function 'initGMMs'
reproduce step:
python main.py -f ~/Downloads/final_demo_data/test1.mp4 -fg=grabcut
result:
Extracting foreground...
0%| | 0/404 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/Users/chinlung/workspace/panoramaProject/main.py", line 103, in
main(args)
File "/Users/chinlung/workspace/panoramaProject/main.py", line 51, in main
fg, bg, fgmasks = cap.extract_foreground(config.fgmode, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/chinlung/workspace/panoramaProject/panorama/video.py", line 145, in extract_foreground
fgmasks = extractor.get_foreground_mask_grabcut(frames)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/chinlung/workspace/panoramaProject/panorama/foreground_extraction.py", line 20, in get_foreground_mask_grabcut
cv2.grabCut(frame, fgmask, rect, bgdModel, fgdModel, 5,
cv2.error: OpenCV(4.6.0) /Users/xperience/actions-runner/_work/opencv-python/opencv-python/opencv/modules/imgproc/src/grabcut.cpp:386: error: (-215:Assertion failed) !bgdSamples.empty() && !fgdSamples.empty() in function 'initGMMs'