当前位置: 首页>>代码示例>>Python>>正文


Python matcher.Matcher方法代码示例

本文整理汇总了Python中maskrcnn_benchmark.modeling.matcher.Matcher方法的典型用法代码示例。如果您正苦于以下问题:Python matcher.Matcher方法的具体用法?Python matcher.Matcher怎么用?Python matcher.Matcher使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在maskrcnn_benchmark.modeling.matcher的用法示例。


在下文中一共展示了matcher.Matcher方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from maskrcnn_benchmark.modeling import matcher [as 别名]
# 或者: from maskrcnn_benchmark.modeling.matcher import Matcher [as 别名]
def __init__(self, proposal_matcher, box_coder,
                 generate_labels_func,
                 sigmoid_focal_loss,
                 bbox_reg_beta=0.11,
                 regress_norm=1.0):
        """
        Arguments:
            proposal_matcher (Matcher)
            box_coder (BoxCoder)
        """
        self.proposal_matcher = proposal_matcher
        self.box_coder = box_coder
        self.box_cls_loss_func = sigmoid_focal_loss
        self.bbox_reg_beta = bbox_reg_beta
        self.copied_fields = ['labels']
        self.generate_labels_func = generate_labels_func
        self.discard_cases = ['between_thresholds']
        self.regress_norm = regress_norm 
开发者ID:Res2Net,项目名称:Res2Net-maskrcnn,代码行数:20,代码来源:loss.py

示例2: make_retinanet_loss_evaluator

# 需要导入模块: from maskrcnn_benchmark.modeling import matcher [as 别名]
# 或者: from maskrcnn_benchmark.modeling.matcher import Matcher [as 别名]
def make_retinanet_loss_evaluator(cfg, box_coder):
    matcher = Matcher(
        cfg.MODEL.RETINANET.FG_IOU_THRESHOLD,
        cfg.MODEL.RETINANET.BG_IOU_THRESHOLD,
        allow_low_quality_matches=True,
    )
    sigmoid_focal_loss = SigmoidFocalLoss(
        cfg.MODEL.RETINANET.LOSS_GAMMA,
        cfg.MODEL.RETINANET.LOSS_ALPHA
    )

    loss_evaluator = RetinaNetLossComputation(
        matcher,
        box_coder,
        generate_retinanet_labels,
        sigmoid_focal_loss,
        bbox_reg_beta = cfg.MODEL.RETINANET.BBOX_REG_BETA,
        regress_norm = cfg.MODEL.RETINANET.BBOX_REG_WEIGHT,
    )
    return loss_evaluator 
开发者ID:Res2Net,项目名称:Res2Net-maskrcnn,代码行数:22,代码来源:loss.py

示例3: make_retinanet_loss_evaluator

# 需要导入模块: from maskrcnn_benchmark.modeling import matcher [as 别名]
# 或者: from maskrcnn_benchmark.modeling.matcher import Matcher [as 别名]
def make_retinanet_loss_evaluator(cfg, box_coder):
    matcher = Matcher(
        cfg.MODEL.RETINANET.FG_IOU_THRESHOLD,
        cfg.MODEL.RETINANET.BG_IOU_THRESHOLD,
        allow_low_quality_matches=True,
    )
    sigmoid_focal_loss = SigmoidFocalLoss(
        cfg.MODEL.RETINANET.LOSS_GAMMA,
        cfg.MODEL.RETINANET.LOSS_ALPHA
    )

    scheme = "free" if cfg.MODEL.SAMPLING_FREE_ON else "focalloss"
    loss_evaluator = eval("RetinaNetLossComputation" + scheme.capitalize())(
        matcher,
        box_coder,
        generate_retinanet_labels,
        sigmoid_focal_loss,
        bbox_reg_beta = cfg.MODEL.RETINANET.BBOX_REG_BETA,
        regress_norm = cfg.MODEL.RETINANET.BBOX_REG_WEIGHT,
    )
    return loss_evaluator 
开发者ID:ChenJoya,项目名称:sampling-free,代码行数:23,代码来源:loss.py

示例4: __init__

# 需要导入模块: from maskrcnn_benchmark.modeling import matcher [as 别名]
# 或者: from maskrcnn_benchmark.modeling.matcher import Matcher [as 别名]
def __init__(self, cfg, box_coder):
        """
        Arguments:
            proposal_matcher (Matcher)
            box_coder (BoxCoder)
        """
        self.box_coder = box_coder
        self.num_classes = cfg.RETINANET.NUM_CLASSES - 1
        self.pre_anchor_topk = cfg.FREEANCHOR.PRE_ANCHOR_TOPK
        self.smooth_l1_loss_param = (cfg.FREEANCHOR.BBOX_REG_WEIGHT, cfg.FREEANCHOR.BBOX_REG_BETA)
        self.bbox_threshold = cfg.FREEANCHOR.BBOX_THRESHOLD
        self.focal_loss_alpha = cfg.FREEANCHOR.FOCAL_LOSS_ALPHA
        self.focal_loss_gamma = cfg.FREEANCHOR.FOCAL_LOSS_GAMMA

        self.positive_bag_loss_func = positive_bag_loss
        self.negative_bag_loss_func = focal_loss 
开发者ID:zhangxiaosong18,项目名称:FreeAnchor,代码行数:18,代码来源:free_anchor_loss.py

示例5: __init__

# 需要导入模块: from maskrcnn_benchmark.modeling import matcher [as 别名]
# 或者: from maskrcnn_benchmark.modeling.matcher import Matcher [as 别名]
def __init__(self, cfg, crop_size, mode, post_branch, size_divisible=0):
        self.size_divisible = size_divisible
        self.mode = mode
        self.crop_size = crop_size
        self.special_deal = cfg.SEARCH.PREFIX_ANCHOR
        self.post_branch = post_branch
        
        if self.mode == 0:
            if self.post_branch == "retina":
                self.anchor_generator = make_anchor_generator_retinanet(cfg)
                self.box_coder = BoxCoder(weights=(10., 10., 5., 5.))
                self.matcher = Matcher(
                    cfg.MODEL.RETINANET.FG_IOU_THRESHOLD,
                    cfg.MODEL.RETINANET.BG_IOU_THRESHOLD,
                    allow_low_quality_matches=True
                )
                self.loss_evaluator = RetinaNetLossComputation(
                    cfg, self.matcher, self.box_coder
                )
            elif self.post_branch == "densebox":
                self.loss_evaluator = DenseBoxLossComputation(cfg)
            else:
                raise ValueError("Post {} do not support now".format(self.post_branch)) 
开发者ID:Lausannen,项目名称:NAS-FCOS,代码行数:25,代码来源:collate_batch.py

示例6: make_retinanet_loss_evaluator

# 需要导入模块: from maskrcnn_benchmark.modeling import matcher [as 别名]
# 或者: from maskrcnn_benchmark.modeling.matcher import Matcher [as 别名]
def make_retinanet_loss_evaluator(cfg, box_coder):
    matcher = Matcher(
        cfg.MODEL.RETINANET.FG_IOU_THRESHOLD,
        cfg.MODEL.RETINANET.BG_IOU_THRESHOLD,
        allow_low_quality_matches=True,
    )
    sigmoid_focal_loss = SigmoidFocalLoss(
        cfg.MODEL.RETINANET.LOSS_GAMMA,
        cfg.MODEL.RETINANET.LOSS_ALPHA
    )

    loss_evaluator = RetinaNetLossComputation(
        matcher,
        box_coder,
        generate_retinanet_labels,
        sigmoid_focal_loss,
        bbox_reg_beta=cfg.MODEL.RETINANET.BBOX_REG_BETA,
        regress_norm=cfg.MODEL.RETINANET.BBOX_REG_WEIGHT,
    )
    return loss_evaluator 
开发者ID:ucas-vg,项目名称:TinyBenchmark,代码行数:22,代码来源:loss.py


注:本文中的maskrcnn_benchmark.modeling.matcher.Matcher方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。