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

IOU error #20

Open
cvchanghao opened this issue Feb 3, 2021 · 4 comments
Open

IOU error #20

cvchanghao opened this issue Feb 3, 2021 · 4 comments

Comments

@cvchanghao
Copy link

cvchanghao commented Feb 3, 2021

Thank you so much for sharing!
But maybe I found an error in utils.py.
When computing IOU, you filtered the pred where mask == 0. It will make the IOU higher.(line 47)
Is it correct?

@chenxi116
Copy link
Owner

So there are some datasets that use class 255 to label pixels that are ambiguous. These pixels should not count towards IOU calculation.

In utils.py I first made sure they are uint8, and then add 1 to the tensor, which will make these 255 to 0. Then these pixels with label 0 (originally labeled 255) are filtered out.

Let me know if this explanation aligns with the code?

@cvchanghao
Copy link
Author

Yes your explanation aligns with the code. But I think we should not do like this.
for example, If the pred has some non-zero prediction but you filtered out, then the area_union will be smaller. which will make the iou larger.
Sorry for my poor English.
举个例子,如果pred里预测的label为1的像素位置,有一些在mask里是255的,那么这部分错误预测就会被过滤掉。在计算IOU时,分母就变小了,IOU自然就变大了。

@chenxi116
Copy link
Owner

I see your concern, but I think another good property of the metric would be: 0.0 for the worst algorithm in the world, and 1.0 for the best algorithm in the world. If I understand your proposal correctly, for datasets with any ambiguous pixel, this metric can never reach 1.0? To me this is not ideal.

Another important aspect is to align with prior implementations, so that the numbers are directly comparable. I believe I checked this implementation against PASCAL calculation and ADE20K calculation.

@cvchanghao
Copy link
Author

Thank you, now i got it

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