From 0475507b2e56d95cf5faf7da5172fd2732712d3a Mon Sep 17 00:00:00 2001 From: bnpzsx <1150892585@qq.com> Date: Mon, 21 Sep 2020 20:09:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DFasterRCNN=E7=B3=BB=E5=88=97?= =?UTF-8?q?=E7=BD=91=E7=BB=9C=E4=BD=BF=E7=94=A8=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?COCO=E6=A0=BC=E5=BC=8F=E6=95=B0=E6=8D=AE=E9=9B=86=E6=97=B6?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原代码中将'background'类ID设为0,会覆盖掉原类别中ID为0的标签。 --- ppdet/utils/coco_eval.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ppdet/utils/coco_eval.py b/ppdet/utils/coco_eval.py index b54be135c..e0186a0de 100644 --- a/ppdet/utils/coco_eval.py +++ b/ppdet/utils/coco_eval.py @@ -427,8 +427,8 @@ def get_category_info_from_anno(anno_file, with_background=True): } catid2name = {cat['id']: cat['name'] for cat in cats} if with_background: - clsid2catid.update({0: 0}) - catid2name.update({0: 'background'}) + clsid2catid.update({0: -1}) + catid2name.update({-1: 'background'}) return clsid2catid, catid2name -- GitLab