当前位置: 首页>>代码示例>>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;未经允许,请勿转载。