未验证 提交 8480af2a 编写于 作者: B bnpzsx 提交者: GitHub

修复FasterRCNN系列网络使用自定义COCO格式数据集时标签错误的问题 (#1457)

原代码中将'background'类ID设为0,会覆盖掉原类别中ID为0的标签。
上级 e74203cf
...@@ -427,8 +427,8 @@ def get_category_info_from_anno(anno_file, with_background=True): ...@@ -427,8 +427,8 @@ def get_category_info_from_anno(anno_file, with_background=True):
} }
catid2name = {cat['id']: cat['name'] for cat in cats} catid2name = {cat['id']: cat['name'] for cat in cats}
if with_background: if with_background:
clsid2catid.update({0: 0}) clsid2catid.update({0: -1})
catid2name.update({0: 'background'}) catid2name.update({-1: 'background'})
return clsid2catid, catid2name return clsid2catid, catid2name
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册