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

Support multiple annotations in the same image of the same class #29

Closed
timofurrer opened this issue Apr 3, 2020 · 1 comment
Closed

Comments

@timofurrer
Copy link

I'd be very useful to get multiple annotations from a single binary mask whereas disconnected shapes are separate annotations instead of one.

Is that something which could make it into this package?

timofurrer added a commit to timofurrer/pycococreator that referenced this issue Apr 4, 2020
waspinator#29

The functionality is implemented in a new function `create_annotation_infos`
with a similar API as the already existing `create_annotation_info`.

I think it makes sense to have a dedicated function for this use-case.

An example is at `samples/multi-annotations`.
timofurrer added a commit to timofurrer/pycococreator that referenced this issue Apr 4, 2020
waspinator#29

The functionality is implemented in a new function `create_annotation_infos`
with a similar API as the already existing `create_annotation_info`.

I think it makes sense to have a dedicated function for this use-case.

An example is at `samples/multi-annotations`.
timofurrer added a commit to timofurrer/pycococreator that referenced this issue Apr 11, 2020
waspinator#29

The functionality is implemented in a new function `create_annotation_infos`
with a similar API as the already existing `create_annotation_info`.

I think it makes sense to have a dedicated function for this use-case.

An example is at `samples/multi-annotations`.
@overclock98
Copy link

overclock98 commented Aug 29, 2020

how do I use "pycococreatortools.create_annotation_infos" ?
I tried to change "pycococreatortools.create_annotation_info" to "pycococreatortools.create_annotation_infos". but when I tried to load json to coco api I'm getting an error,


loading annotations into memory...
Done (t=0.11s)
creating index...
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-131-b9f9f7b13f18> in <module>()
----> 1 example_coco = COCO(annotation_file)

1 frames
/usr/local/lib/python3.6/dist-packages/pycocotools/coco.py in createIndex(self)
     92         if 'annotations' in self.dataset:
     93             for ann in self.dataset['annotations']:
---> 94                 imgToAnns[ann['image_id']].append(ann)
     95                 anns[ann['id']] = ann
     96 

TypeError: list indices must be integers or slices, not str

this is my notebook
https://github.com/overclock98/PSB-2015-crowdsourced-nuclei-dataset-to-coco/blob/master/PSB_2015_crowdsourced_nuclei_dataset_to_coco.ipynb

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