senguptaumd / Background-Matting

Background Matting: The World is Your Green Screen
https://grail.cs.washington.edu/projects/background-matting/
4.78k stars 664 forks source link

colab notebook "Process Image" throws error at test_background-matting_image.py #46

Open anurag-priyadarshi opened 4 years ago

anurag-priyadarshi commented 4 years ago

Running the colab notebook works fine till segmentation. Using sample images itself. I did 'fix' path etc. till this point. Getting this error

CUDA Device: 0
Using image mode
Traceback (most recent call last):
  File "Background-Matting/test_background-matting_image.py", line 121, in <module>
    bbox=get_bbox(rcnn,R=bgr_img0.shape[0],C=bgr_img0.shape[1])
  File "/content/Background-Matting/functions.py", line 38, in get_bbox
    x1, y1 = np.amin(where, axis=1)
  File "<__array_function__ internals>", line 6, in amin
  File "/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py", line 2746, in amin
    keepdims=keepdims, initial=initial, where=where)
  File "/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py", line 90, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation minimum which has no identity`

Will diagnose more and share updates

senguptaumd commented 4 years ago

Did the segmentation work? Feel like rcnn or segmentation mask is actually null.

anurag-priyadarshi commented 4 years ago

@senguptaumd I could see the segmentation mask ...masksDL.png with the background neatly removed. I will spend some time and try to diagnose this. Some matrix is empty for sure. I will keep you posted and request to close this once I am done.

ghost commented 4 years ago

I also have the exact same error and cannot get past this point.

siddas27 commented 4 years ago

@anurag-priyadarshi @CorgJR Did you guys find any solution to this?

anurag-priyadarshi commented 4 years ago

@siddas27 Didn't dig deeper into it. But do check the path variable. I felt something was missing around those lines.

L-Dressen commented 3 years ago

I have this error too since today. I already successfully did the process a few times, but today it threw this error. Advice is needed

somenewaccountthen commented 3 years ago

Is it is because the frame is the same as the background, aka empty. And there is nothing to segment and code crashes coz can't handle that?