Commit 02c40d10 authored by Yuxin Wu's avatar Yuxin Wu

[MaskRCNN] set FPN to default; don't eval mask if not used

parent 0146287b
This diff is collapsed.
......@@ -80,7 +80,7 @@ _C = config # short alias to avoid coding
# mode flags ---------------------
_C.TRAINER = 'replicated' # options: 'horovod', 'replicated'
_C.MODE_MASK = True # Faster R-CNN or Mask R-CNN
_C.MODE_FPN = False
_C.MODE_FPN = True
# dataset -----------------------
_C.DATA.BASEDIR = '/path/to/your/DATA/DIR'
......
......@@ -70,6 +70,8 @@ class COCODetection(DatasetSplit):
"""
from pycocotools.cocoeval import COCOeval
ret = {}
has_mask = "segmentation" in results[0] # results will be modified by loadRes
cocoDt = self.coco.loadRes(results)
cocoEval = COCOeval(self.coco, cocoDt, 'bbox')
cocoEval.evaluate()
......@@ -79,7 +81,7 @@ class COCODetection(DatasetSplit):
for k in range(6):
ret['mAP(bbox)/' + fields[k]] = cocoEval.stats[k]
if len(results) > 0 and 'segmentation' in results[0]:
if len(results) > 0 and has_mask:
cocoEval = COCOeval(self.coco, cocoDt, 'segm')
cocoEval.evaluate()
cocoEval.accumulate()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment