Background-Matting
Background-Matting copied to clipboard
colab notebook "Process Image" throws error at test_background-matting_image.py
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
Did the segmentation work? Feel like rcnn
or segmentation mask is actually null.
@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.
I also have the exact same error and cannot get past this point.
@anurag-priyadarshi @CorgJR Did you guys find any solution to this?
@siddas27 Didn't dig deeper into it. But do check the path variable. I felt something was missing around those lines.
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
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?