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

Why is nums_classes set to 91 and but,the actual number of categories in coco's dataset is 80 #46

Closed
lihuikenny opened this issue Jul 28, 2022 · 3 comments

Comments

@lihuikenny
Copy link

@IDEACVR

@HaoZhang534
Copy link
Contributor

HaoZhang534 commented Jul 28, 2022

COCO has 90 categories that have class id 1-90. nums_classes is set to 91 for convenience so that we do not need to map class id to 0-79.

@lihuikenny
Copy link
Author

@SuperHenry2333 【中文说了哈】我看作者的代码,初始化注册模型的时候都是用91,那么模型的最后分类层应该是【N,91】,但是实际是只有80类【加背景81】,当然我的经验告诉我,实际类别是可以小于预设的分类层数量【不能大于】。后面我尝试设置nums_classes=81,却不行。不知道读取coco数据的时候,底层是怎么转换的?也许我需要去研究一下coco数据读取底层的代码,如果您知道其中的原因,还请解惑,谢谢。

@BinhuiXie
Copy link

Hi, @lihuikenny

This discussion facebookresearch/detr#108 might be helpful!

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

3 participants