未验证 提交 e6e9865f 编写于 作者: W wangguanzhong 提交者: GitHub

refine log when mask is empty (#3579)

上级 2f22d577
...@@ -108,9 +108,10 @@ def mask_eval(results, anno_file, outfile, resolution, thresh_binarize=0.5): ...@@ -108,9 +108,10 @@ def mask_eval(results, anno_file, outfile, resolution, thresh_binarize=0.5):
clsid2catid = {i + 1: v for i, v in enumerate(coco_gt.getCatIds())} clsid2catid = {i + 1: v for i, v in enumerate(coco_gt.getCatIds())}
segm_results = mask2out(results, clsid2catid, resolution, thresh_binarize) segm_results = mask2out(results, clsid2catid, resolution, thresh_binarize)
assert len( if len(segm_results) == 0:
segm_results) > 0, "The number of valid mask detected is zero.\n \ logger.warning("The number of valid mask detected is zero.\n \
Please use reasonable model and check input data." Please use reasonable model and check input data.")
return
with open(outfile, 'w') as f: with open(outfile, 'w') as f:
json.dump(segm_results, f) json.dump(segm_results, f)
...@@ -556,4 +557,4 @@ def coco17_category_info(with_background=True): ...@@ -556,4 +557,4 @@ def coco17_category_info(with_background=True):
if not with_background: if not with_background:
clsid2catid = {k - 1: v for k, v in clsid2catid.items()} clsid2catid = {k - 1: v for k, v in clsid2catid.items()}
return clsid2catid, catid2name return clsid2catid, catid2name
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册