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

getAnnIds: areaRng not inclusive of limits #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ashnair1
Copy link

If you were to query annotations within a particular area range, via the getAnnIds function, it ignores those objects that have areas equal to the limits.

For example,

# Assuming objects areas only lie between 10^2 and 1e5^2 pixels

areaRng = [10,32,64,96]

small    = len(ann.getAnnIds(areaRng=[(areaRng[0]**2) , areaRng[1]**2]))
medium   = len(ann.getAnnIds(areaRng=[(areaRng[1]**2) , areaRng[2]**2]))
large    = len(ann.getAnnIds(areaRng=[(areaRng[2]**2) , areaRng[3]**2]))
total = len(ann.getAnnIds(areaRng=[(areaRng[0]**2), (areaRng[3]**2)]))

assert total = small + medium + large

The assertion would fail if there are objects that have area exactly equal to 10^2, 32^2, 64^2 or 96 ^2 pixels.

@ashnair1
Copy link
Author

Hi @ppwwyyxx, any thoughts on this PR?

@ppwwyyxx
Copy link
Owner

Though I agree that the code is incorrect, this will change the evaluation results and therefore have major consequences. Please send it to the official repo instead of this fork.

I do not want to diverge from the official repo in evaluation results, even when the official repo is wrong.

@ashnair1
Copy link
Author

Fair enough. I've opened cocodataset/cocoapi#568 for this fix.

@ashnair1
Copy link
Author

@ppwwyyxx Do you know who currently maintains the official repo?

@fcakyon
Copy link

fcakyon commented Apr 28, 2022

As far as I understood, official repo is not being maintained

@ppwwyyxx ppwwyyxx closed this Mar 23, 2023
@ppwwyyxx ppwwyyxx reopened this Mar 23, 2023
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.

3 participants