Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in converting the instance segmentation mask encoding from bdd100k to coco #9

Closed
sfarkya04 opened this issue Jan 7, 2022 · 1 comment

Comments

@sfarkya04
Copy link

sfarkya04 commented Jan 7, 2022

Hello,

I am trying to convert the bdd100k instance segmentation using this command:
python3 -m bdd100k.label.to_coco -m ins_seg --only-mask -i ./bdd100k/labels/ins_seg/bitmasks/val -o ./ins_seg_val_cocofmt_v2.json

Also, tried this:
python3 -m bdd100k.label.to_coco -m ins_seg -i ./bdd100k/labels/ins_seg/polygons/ins_seg_val.json -o ./ins_seg_val_cocofmt_v3.json -mb ./bdd100k/labels/ins_seg/bitmasks/val

The conversion is successful in both cases and the annotation looks like this

Screen Shot 2022-01-07 at 11 46 36 AM
** that's not how coco annotations are.

Now, if you see the segmentation field above there's string encoding of the masks. Now, I am unsure if that's expected or not.

Further, assuming it's correct, I tried to load the annotations using loader from DETR https://github.com/facebookresearch/detr/blob/091a817eca74b8b97e35e4531c1c39f89fbe38eb/datasets/coco.py#L36

The line I have mentioned above is supposed to do the conversion but I am getting an error from the pycocotools that it's not expecting a string in the mask.
Screen Shot 2022-01-07 at 11 53 51 AM

So, I am unsure where the problem is? Is the conversion correct to coco then the loader should work?
Note: I tried to convert the detections and they worked fine.

Thank you for any help you can provide.

@sfarkya04 sfarkya04 changed the title Issue in converting the instance segmentation mask from bdd100k to coco Issue in converting the instance segmentation mask encoding from bdd100k to coco Jan 7, 2022
@thomasehuang
Copy link
Collaborator

Responded in BDD100K repo here: bdd100k/bdd100k#206 (comment). Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants