cocodataset / panopticapi

COCO 2018 Panoptic Segmentation Task API (Beta version)
Other
423 stars 185 forks source link

UTF8 decoding error #28

Open discretecoder opened 5 years ago

discretecoder commented 5 years ago

Hello,

I am using python 3 and i have some issues storing json files from panoptic to detection and panoptic to semantic segmentation conversion.

In panoptictosemantic conversion, the data from RLE is not gettiing decoded to utf 8 and it throws an error when it tries to save the data from 'count' on from RLE in the json as its bytes.

interestingly same code works in the panoptictodetection conversion but it converts the byte as it is to a string as in the image attached.

has anyone seen the same issue?

thanks utf problem

bliptrip commented 2 years ago

I have also had this issue (not sure if you've resolved since you posted). I traced the problem down to line 81 of panoptic2semantic_segmentation.py. The issue seems to be with newer pycocotools library recasting the RLE list back to bytes type when doing the merge. If you simply recast by adding the expression RLE['counts'] = RLE['counts'].decode('utf-8') after line 81, the problem appears to go away (at least it works for me).

I would issue a PR on this, but it doesn't appear that this repository is being actively maintained (correct me if I'm wrong, or if there is a new location to go for an actively maintained repo.).