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

Add a way to exclude categories #517

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

GeorgeBatch
Copy link

Hi,

Thank you for providing the API! It makes using Coco much easier.

I added an option to exclude a category so that the user can specify that they want to get imgIds for all images of categories ['person', 'dog', 'skateboard'], but only those which do not include [car]. I just added a couple of cells in the Demo showing how it's used. In short, the user gets Ids for the categories they want to include (like before) and for the categories they want to exclude (new).

I personally needed this functionality to get disjoint sets of Ids to understand how many images there are in each of the 2^{num categories of interest} groups but thought that it can be useful for other applications.

Many thanks,
George

@GeorgeBatch
Copy link
Author

I also added an example of using the new functionality to get the Ids for disjoint categories, e.g. the set of ids for ('person', 'dog') and for ('person', 'dog', 'cat') will be disjoint. This provides a simple way to create labels for multi-label binary classification ("Is cat present or not?"), but more importantly, gives the full breakdown of IDs for the 2*{num categories of interest} groups to use in error analysis. These groups also can be used for a general understanding of how often certain classes appear on the image together.

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

Successfully merging this pull request may close these issues.

1 participant