當前位置: 首頁>>代碼示例>>Python>>正文


Python box_coder.BoxCoder方法代碼示例

本文整理匯總了Python中maskrcnn_benchmark.modeling.box_coder.BoxCoder方法的典型用法代碼示例。如果您正苦於以下問題:Python box_coder.BoxCoder方法的具體用法?Python box_coder.BoxCoder怎麽用?Python box_coder.BoxCoder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在maskrcnn_benchmark.modeling.box_coder的用法示例。


在下文中一共展示了box_coder.BoxCoder方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def __init__(
        self, 
        proposal_matcher, 
        fg_bg_sampler, 
        box_coder, 
        cls_agnostic_bbox_reg=False
    ):
        """
        Arguments:
            proposal_matcher (Matcher)
            fg_bg_sampler (BalancedPositiveNegativeSampler)
            box_coder (BoxCoder)
        """
        self.proposal_matcher = proposal_matcher
        self.fg_bg_sampler = fg_bg_sampler
        self.box_coder = box_coder
        self.cls_agnostic_bbox_reg = cls_agnostic_bbox_reg 
開發者ID:Res2Net,項目名稱:Res2Net-maskrcnn,代碼行數:19,代碼來源:loss.py

示例2: make_roi_box_loss_evaluator

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def make_roi_box_loss_evaluator(cfg):
    matcher = Matcher(
        cfg.MODEL.ROI_HEADS.FG_IOU_THRESHOLD,
        cfg.MODEL.ROI_HEADS.BG_IOU_THRESHOLD,
        allow_low_quality_matches=False,
    )

    bbox_reg_weights = cfg.MODEL.ROI_HEADS.BBOX_REG_WEIGHTS
    box_coder = BoxCoder(weights=bbox_reg_weights)

    fg_bg_sampler = BalancedPositiveNegativeSampler(
        cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE, cfg.MODEL.ROI_HEADS.POSITIVE_FRACTION
    )

    cls_agnostic_bbox_reg = cfg.MODEL.CLS_AGNOSTIC_BBOX_REG

    loss_evaluator = FastRCNNLossComputation(
        matcher, 
        fg_bg_sampler, 
        box_coder, 
        cls_agnostic_bbox_reg
    )

    return loss_evaluator 
開發者ID:Res2Net,項目名稱:Res2Net-maskrcnn,代碼行數:26,代碼來源:loss.py

示例3: __init__

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def __init__(
        self,
        score_thresh=0.05,
        nms=0.5,
        detections_per_img=100,
        box_coder=None,
        cls_agnostic_bbox_reg=False
    ):
        """
        Arguments:
            score_thresh (float)
            nms (float)
            detections_per_img (int)
            box_coder (BoxCoder)
        """
        super(PostProcessor, self).__init__()
        self.score_thresh = score_thresh
        self.nms = nms
        self.detections_per_img = detections_per_img
        if box_coder is None:
            box_coder = BoxCoder(weights=(10., 10., 5., 5.))
        self.box_coder = box_coder
        self.cls_agnostic_bbox_reg = cls_agnostic_bbox_reg 
開發者ID:Res2Net,項目名稱:Res2Net-maskrcnn,代碼行數:25,代碼來源:inference.py

示例4: make_roi_box_post_processor

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def make_roi_box_post_processor(cfg):
    use_fpn = cfg.MODEL.ROI_HEADS.USE_FPN

    bbox_reg_weights = cfg.MODEL.ROI_HEADS.BBOX_REG_WEIGHTS
    box_coder = BoxCoder(weights=bbox_reg_weights)

    score_thresh = cfg.MODEL.ROI_HEADS.SCORE_THRESH
    nms_thresh = cfg.MODEL.ROI_HEADS.NMS
    detections_per_img = cfg.MODEL.ROI_HEADS.DETECTIONS_PER_IMG
    cls_agnostic_bbox_reg = cfg.MODEL.CLS_AGNOSTIC_BBOX_REG

    postprocessor = PostProcessor(
        score_thresh,
        nms_thresh,
        detections_per_img,
        box_coder,
        cls_agnostic_bbox_reg
    )
    return postprocessor 
開發者ID:Res2Net,項目名稱:Res2Net-maskrcnn,代碼行數:21,代碼來源:inference.py

示例5: __init__

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def __init__(self, cfg, in_channels):
        super(RPNModule, self).__init__()

        self.cfg = cfg.clone()

        anchor_generator = make_anchor_generator(cfg)

        rpn_head = registry.RPN_HEADS[cfg.MODEL.RPN.RPN_HEAD]
        head = rpn_head(
            cfg, in_channels, anchor_generator.num_anchors_per_location()[0]
        )

        rpn_box_coder = BoxCoder(weights=(1.0, 1.0, 1.0, 1.0))

        box_selector_train = make_rpn_postprocessor(cfg, rpn_box_coder, is_train=True)
        box_selector_test = make_rpn_postprocessor(cfg, rpn_box_coder, is_train=False)

        loss_evaluator = make_rpn_loss_evaluator(cfg, rpn_box_coder)

        self.anchor_generator = anchor_generator
        self.head = head
        self.box_selector_train = box_selector_train
        self.box_selector_test = box_selector_test
        self.loss_evaluator = loss_evaluator 
開發者ID:Res2Net,項目名稱:Res2Net-maskrcnn,代碼行數:26,代碼來源:rpn.py

示例6: __init__

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def __init__(
        self, 
        proposal_matcher, 
        fg_bg_sampler,
        box_coder,
        quad_box_coder,
        cls_agnostic_bbox_reg=False
    ):
        """
        Arguments:
            proposal_matcher (Matcher)
            fg_bg_sampler (BalancedPositiveNegativeSampler)
            box_coder (BoxCoder)
        """
        self.proposal_matcher = proposal_matcher
        self.fg_bg_sampler = fg_bg_sampler
        self.box_coder = box_coder
        self.quad_box_coder = quad_box_coder
        self.cls_agnostic_bbox_reg = cls_agnostic_bbox_reg 
開發者ID:Xiangyu-CAS,項目名稱:R2CNN.pytorch,代碼行數:21,代碼來源:loss.py

示例7: __init__

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def __init__(
        self,
        score_thresh=0.05,
        nms=0.5,
        detections_per_img=100,
        box_coder=None,
        quad_box_coder=None,
        cls_agnostic_bbox_reg=False
    ):
        """
        Arguments:
            score_thresh (float)
            nms (float)
            detections_per_img (int)
            box_coder (BoxCoder)
        """
        super(PostProcessor, self).__init__()
        self.score_thresh = score_thresh
        self.nms = nms
        self.detections_per_img = detections_per_img
        if box_coder is None:
            box_coder = BoxCoder(weights=(10., 10., 5., 5.))
        self.box_coder = box_coder
        self.quad_box_coder = quad_box_coder
        self.cls_agnostic_bbox_reg = cls_agnostic_bbox_reg 
開發者ID:Xiangyu-CAS,項目名稱:R2CNN.pytorch,代碼行數:27,代碼來源:inference.py

示例8: make_roi_box_post_processor

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def make_roi_box_post_processor(cfg):
    use_fpn = cfg.MODEL.ROI_HEADS.USE_FPN

    bbox_reg_weights = cfg.MODEL.ROI_HEADS.BBOX_REG_WEIGHTS
    box_coder = BoxCoder(weights=bbox_reg_weights)
    quad_bbox_reg_weights = cfg.MODEL.ROI_HEADS.QUAD_BBOX_REG_WEIGHTS
    quad_box_coder = QuadBoxCoder(weights=quad_bbox_reg_weights)

    score_thresh = cfg.MODEL.ROI_HEADS.SCORE_THRESH
    nms_thresh = cfg.MODEL.ROI_HEADS.NMS
    detections_per_img = cfg.MODEL.ROI_HEADS.DETECTIONS_PER_IMG
    cls_agnostic_bbox_reg = cfg.MODEL.CLS_AGNOSTIC_BBOX_REG

    postprocessor = PostProcessor(
        score_thresh,
        nms_thresh,
        detections_per_img,
        box_coder,
        quad_box_coder,
        cls_agnostic_bbox_reg
    )
    return postprocessor 
開發者ID:Xiangyu-CAS,項目名稱:R2CNN.pytorch,代碼行數:24,代碼來源:inference.py

示例9: __init__

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def __init__(
        self,
        proposal_matcher,
        fg_bg_sampler,
        box_coder,
        cls_agnostic_bbox_reg=False
    ):
        """
        Arguments:
            proposal_matcher (Matcher)
            fg_bg_sampler (BalancedPositiveNegativeSampler)
            box_coder (BoxCoder)
        """
        self.proposal_matcher = proposal_matcher
        self.fg_bg_sampler = fg_bg_sampler
        self.box_coder = box_coder
        self.cls_agnostic_bbox_reg = cls_agnostic_bbox_reg 
開發者ID:simaiden,項目名稱:Clothing-Detection,代碼行數:19,代碼來源:loss.py

示例10: make_roi_box_loss_evaluator

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def make_roi_box_loss_evaluator(cfg):
    matcher = Matcher(
        cfg.MODEL.ROI_HEADS.FG_IOU_THRESHOLD,
        cfg.MODEL.ROI_HEADS.BG_IOU_THRESHOLD,
        allow_low_quality_matches=False,
    )

    bbox_reg_weights = cfg.MODEL.ROI_HEADS.BBOX_REG_WEIGHTS
    box_coder = BoxCoder(weights=bbox_reg_weights)

    fg_bg_sampler = BalancedPositiveNegativeSampler(
        cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE, cfg.MODEL.ROI_HEADS.POSITIVE_FRACTION
    )

    cls_agnostic_bbox_reg = cfg.MODEL.CLS_AGNOSTIC_BBOX_REG

    loss_evaluator = FastRCNNLossComputation(
        matcher,
        fg_bg_sampler,
        box_coder,
        cls_agnostic_bbox_reg
    )

    return loss_evaluator 
開發者ID:simaiden,項目名稱:Clothing-Detection,代碼行數:26,代碼來源:loss.py

示例11: __init__

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def __init__(
        self,
        score_thresh=0.05,
        nms=0.5,
        detections_per_img=100,
        box_coder=None,
        cls_agnostic_bbox_reg=False,
        bbox_aug_enabled=False
    ):
        """
        Arguments:
            score_thresh (float)
            nms (float)
            detections_per_img (int)
            box_coder (BoxCoder)
        """
        super(PostProcessor, self).__init__()
        self.score_thresh = score_thresh
        self.nms = nms
        self.detections_per_img = detections_per_img
        if box_coder is None:
            box_coder = BoxCoder(weights=(10., 10., 5., 5.))
        self.box_coder = box_coder
        self.cls_agnostic_bbox_reg = cls_agnostic_bbox_reg
        self.bbox_aug_enabled = bbox_aug_enabled 
開發者ID:simaiden,項目名稱:Clothing-Detection,代碼行數:27,代碼來源:inference.py

示例12: make_roi_box_post_processor

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def make_roi_box_post_processor(cfg):
    use_fpn = cfg.MODEL.ROI_HEADS.USE_FPN

    bbox_reg_weights = cfg.MODEL.ROI_HEADS.BBOX_REG_WEIGHTS
    box_coder = BoxCoder(weights=bbox_reg_weights)

    score_thresh = cfg.MODEL.ROI_HEADS.SCORE_THRESH
    nms_thresh = cfg.MODEL.ROI_HEADS.NMS
    detections_per_img = cfg.MODEL.ROI_HEADS.DETECTIONS_PER_IMG
    cls_agnostic_bbox_reg = cfg.MODEL.CLS_AGNOSTIC_BBOX_REG
    bbox_aug_enabled = False #cfg.TEST.BBOX_AUG.ENABLED

    postprocessor = PostProcessor(
        score_thresh,
        nms_thresh,
        detections_per_img,
        box_coder,
        cls_agnostic_bbox_reg,
        bbox_aug_enabled
    )
    return postprocessor 
開發者ID:simaiden,項目名稱:Clothing-Detection,代碼行數:23,代碼來源:inference.py

示例13: make_roi_box_post_processor

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def make_roi_box_post_processor(cfg):
    use_fpn = cfg.MODEL.ROI_HEADS.USE_FPN

    bbox_reg_weights = cfg.MODEL.ROI_HEADS.BBOX_REG_WEIGHTS
    box_coder = BoxCoder(weights=bbox_reg_weights)

    score_thresh = cfg.MODEL.ROI_HEADS.SCORE_THRESH
    nms_thresh = cfg.MODEL.ROI_HEADS.NMS
    detections_per_img = cfg.MODEL.ROI_HEADS.DETECTIONS_PER_IMG
    cls_agnostic_bbox_reg = cfg.MODEL.CLS_AGNOSTIC_BBOX_REG
    bbox_aug_enabled = cfg.TEST.BBOX_AUG.ENABLED

    postprocessor = PostProcessor(
        score_thresh,
        nms_thresh,
        detections_per_img,
        box_coder,
        cls_agnostic_bbox_reg,
        bbox_aug_enabled
    )
    return postprocessor 
開發者ID:megvii-model,項目名稱:DetNAS,代碼行數:23,代碼來源:inference.py

示例14: __init__

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def __init__(self, cfg):
        super(RPNModule, self).__init__()

        self.cfg = cfg.clone()

        anchor_generator = make_anchor_generator(cfg)

        in_channels = cfg.MODEL.BACKBONE.OUT_CHANNELS
        rpn_head = registry.RPN_HEADS[cfg.MODEL.RPN.RPN_HEAD]
        head = rpn_head(
            cfg, in_channels, anchor_generator.num_anchors_per_location()[0]
        )

        rpn_box_coder = BoxCoder(weights=(1.0, 1.0, 1.0, 1.0))

        box_selector_train = make_rpn_postprocessor(cfg, rpn_box_coder, is_train=True)
        box_selector_test = make_rpn_postprocessor(cfg, rpn_box_coder, is_train=False)

        loss_evaluator = make_rpn_loss_evaluator(cfg, rpn_box_coder)

        self.anchor_generator = anchor_generator
        self.head = head
        self.box_selector_train = box_selector_train
        self.box_selector_test = box_selector_test
        self.loss_evaluator = loss_evaluator 
開發者ID:clw5180,項目名稱:remote_sensing_object_detection_2019,代碼行數:27,代碼來源:rpn.py

示例15: make_roi_box_loss_evaluator

# 需要導入模塊: from maskrcnn_benchmark.modeling import box_coder [as 別名]
# 或者: from maskrcnn_benchmark.modeling.box_coder import BoxCoder [as 別名]
def make_roi_box_loss_evaluator(cfg):
    matcher = Matcher(
        cfg.MODEL.ROI_HEADS.FG_IOU_THRESHOLD,
        cfg.MODEL.ROI_HEADS.BG_IOU_THRESHOLD,
        allow_low_quality_matches=False,
    )

    bbox_reg_weights = cfg.MODEL.ROI_HEADS.BBOX_REG_WEIGHTS
    box_coder = BoxCoder(weights=bbox_reg_weights)

    fg_bg_sampler = BalancedPositiveNegativeSampler(
        cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE, cfg.MODEL.ROI_HEADS.POSITIVE_FRACTION
    )

    loss_evaluator = FastRCNNLossComputation(matcher, fg_bg_sampler, box_coder)

    return loss_evaluator 
開發者ID:clw5180,項目名稱:remote_sensing_object_detection_2019,代碼行數:19,代碼來源:loss.py


注:本文中的maskrcnn_benchmark.modeling.box_coder.BoxCoder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。