Commit 327bc29b authored by Levi Viana's avatar Levi Viana Committed by Francisco Massa

Some cleaning and changing default argument from `boxlist_nms` (#429)

* Adding support to Caffe2 ResNeXt-152-32x8d-FPN-IN5k backbone for Mask R-CNN

* Clean up

* Fixing path_catalogs.py

* Back to old ROIAlign_cpu.cpp file
parent 13b4f82e
......@@ -17,10 +17,10 @@ class PostProcessor(nn.Module):
"""
def __init__(
self,
score_thresh=0.05,
nms=0.5,
detections_per_img=100,
self,
score_thresh=0.05,
nms=0.5,
detections_per_img=100,
box_coder=None,
cls_agnostic_bbox_reg=False
):
......@@ -123,7 +123,7 @@ class PostProcessor(nn.Module):
boxlist_for_class = BoxList(boxes_j, boxlist.size, mode="xyxy")
boxlist_for_class.add_field("scores", scores_j)
boxlist_for_class = boxlist_nms(
boxlist_for_class, self.nms, score_field="scores"
boxlist_for_class, self.nms
)
num_labels = len(boxlist_for_class)
boxlist_for_class.add_field(
......@@ -158,9 +158,9 @@ def make_roi_box_post_processor(cfg):
cls_agnostic_bbox_reg = cfg.MODEL.CLS_AGNOSTIC_BBOX_REG
postprocessor = PostProcessor(
score_thresh,
nms_thresh,
detections_per_img,
score_thresh,
nms_thresh,
detections_per_img,
box_coder,
cls_agnostic_bbox_reg
)
......
......@@ -6,7 +6,7 @@ from .bounding_box import BoxList
from maskrcnn_benchmark.layers import nms as _box_nms
def boxlist_nms(boxlist, nms_thresh, max_proposals=-1, score_field="score"):
def boxlist_nms(boxlist, nms_thresh, max_proposals=-1, score_field="scores"):
"""
Performs non-maximum suppression on a boxlist, with scores specified
in a boxlist field via score_field.
......@@ -15,7 +15,7 @@ def boxlist_nms(boxlist, nms_thresh, max_proposals=-1, score_field="score"):
boxlist(BoxList)
nms_thresh (float)
max_proposals (int): if > 0, then only the top max_proposals are kept
after non-maxium suppression
after non-maximum suppression
score_field (str)
"""
if nms_thresh <= 0:
......
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