Background-Matting icon indicating copy to clipboard operation
Background-Matting copied to clipboard

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

Open anurag-priyadarshi opened this issue 4 years ago • 7 comments

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

anurag-priyadarshi avatar May 20 '20 13:05 anurag-priyadarshi

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

senguptaumd avatar May 22 '20 01:05 senguptaumd

@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.

anurag-priyadarshi avatar May 26 '20 10:05 anurag-priyadarshi

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

ghost avatar May 31 '20 19:05 ghost

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

siddas27 avatar Jun 20 '20 07:06 siddas27

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

anurag-priyadarshi avatar Jun 22 '20 10:06 anurag-priyadarshi

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

L-Dressen avatar Oct 05 '20 12:10 L-Dressen

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?

somenewaccountthen avatar Apr 14 '21 23:04 somenewaccountthen