cocoapi
cocoapi copied to clipboard
getAnnIds: areaRng not inclusive of limits
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.
Hi @ppwwyyxx, any thoughts on this PR?
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.
Fair enough. I've opened cocodataset/cocoapi#568 for this fix.
@ppwwyyxx Do you know who currently maintains the official repo?
As far as I understood, official repo is not being maintained