Clothing-Matching icon indicating copy to clipboard operation
Clothing-Matching copied to clipboard

Cloth-masking error

Open arhamlet opened this issue 3 years ago • 1 comments

I am using the cloth masking repo to generate shirt segmentation. I am trying to run it on the viton shirts folder. It runs fine on most of the images but on some images the algorithm throws an error while running 1.clothmasking_grabcut.

Traceback (most recent call last): File "1.clothmasking_GrabCut.py", line 124, in main() File "1.clothmasking_GrabCut.py", line 120, in main cloth_masking_with_grabcut(image_path, res_path, viz=False) File "1.clothmasking_GrabCut.py", line 84, in cloth_masking_with_grabcut gc_mask, bgdModel, fgdModel = cv2.grabCut(img2, gc_mask, None, bgdModel, fgdModel, 10, cv2.GC_INIT_WITH_MASK) cv2.error: OpenCV(3.4.14) /tmp/pip-req-build-jlfc4ffm/opencv/modules/imgproc/src/grabcut.cpp:385: error: (-215:Assertion failed) !bgdSamples.empty() && !fgdSamples.empty() in function 'initGMMs'

arhamlet avatar Oct 05 '21 18:10 arhamlet