sahi icon indicating copy to clipboard operation
sahi copied to clipboard

empty segmentation fix

Open timonpalm opened this issue 1 year ago • 1 comments

I struggle with an issue that sometimes the model returns an empty mask which eventually let the program fail.

Either poly1 or poly2 was an empty polygon, taking the union with that will also always result in an empty polygon. I simply fixed it by setting the merged polygon to the not empty one.

That worked fine for me and I thought maybe someone else had the same error and this is a reasonable change.

timonpalm avatar Nov 11 '24 22:11 timonpalm

    xmin = max(bbox[0], 0)
               ~~~~^^^
TypeError: 'NoneType' object is not subscriptable

mookghg avatar Dec 12 '24 10:12 mookghg

Closing this due to inactivity, it might already be fixed in the latest version of SAHI.

fcakyon avatar Jul 01 '25 10:07 fcakyon

Closing this due to inactivity, it might already be fixed in the latest version of SAHI.

I ended up forking and making a context specific fix

mookghg avatar Jul 01 '25 10:07 mookghg