Open rbavery opened 2 years ago
possibly related to https://github.com/cocodataset/cocoapi/issues/362
I've tracked that this is an issue with pycocotools, which appears to be unmaintained. any help is much appreciated.
here's a reproducible example that causes a seg fault
from pycocotools import mask
erles = [{'size': [4176, 6443],
'counts': b'\\UbU74QU70OO02N00001O002NN3O02NN30N3N11MO211NN201OO21OM1120NO100002N01M22N1ON40NN22MO220N0O12N00O11O02N0010O00N22L22N001O011L21M3ON3O11NO2O02NN22N02NN20O30MO220NN21O1N30M10N22N02NN22N01N12NN11O21OO0OO22N10M31N000O12L21M22N01OO1002ON10000002NN22NN30O2OM11O3OO001M22N10M130MO3N12L21M22N02NN22NN30M22N000002N00N31N10M1101O1O01O000O12N02MO3O02NO110O01O00N22NO1002ON11O02NN20O12OO0O111NN2002OM21M40L22NN22N02NO12OO1OO12N00N201O01O0020N0N22L22M12OO02NN2002NN2020ON12NN040N0N130OO1OO120L20N40M110N12N000000001OO21N00O12N02L03O010O1O002NN20002ON21M12NN20020M11gi[Zb0'}]
mask.decode(erles)
this is also happening with 224, 224 masks. a work around is using the mask_array attribute instead
valid_ds[0].detection.mask_array[0].data
works
🐛 Bug
I have the following record
above is the record in dict form, before calling
.as_dict
it is this type<icevision.core.mask.RLE at 0x7fdd155ecb20>
then when I try to convert this to a mask, the kernel crashes
To Reproduce Steps to reproduce the behavior: I'm not certain but maybe this is due to the image size, 6443, 4176. and from looking at the to_mask func maybe there is some error in that func causing memory to blow up.
Expected behavior Return the mask. this works for 512x512 images. But I'd really like it to work for larger images so that I can use the same code for calculating statistics, etc. that expects a coco dictionary.
Desktop (please complete the following information):