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


Python boxlist_ops.boxlist_iou方法代码示例

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


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

示例1: match_targets_to_anchors

# 需要导入模块: from maskrcnn_benchmark.structures import boxlist_ops [as 别名]
# 或者: from maskrcnn_benchmark.structures.boxlist_ops import boxlist_iou [as 别名]
def match_targets_to_anchors(self, anchor, target, copied_fields=[]):
        match_quality_matrix = boxlist_iou(target, anchor)
        # ################# changed by hui ###################################################
        if len(target.bbox) == 0:
            matched_idxs = torch.LongTensor([-1] * match_quality_matrix.shape[1])
        else:
            matched_idxs = self.proposal_matcher(match_quality_matrix)

        # for anchor recall cal
        # if self.debug:
        #     record_for_recall(matched_idxs, target)
        #####################################################################################

        # RPN doesn't need any fields from target
        # for creating the labels, so clear them all
        target = target.copy_with_fields(copied_fields)
        # get the targets corresponding GT for each anchor
        # NB: need to clamp the indices because we can have a single
        # GT in the image, and matched_idxs can be -2, which goes
        # out of bounds
        matched_targets = target[matched_idxs.clamp(min=0)]
        matched_targets.add_field("matched_idxs", matched_idxs)
        return matched_targets 
开发者ID:ucas-vg,项目名称:TinyBenchmark,代码行数:25,代码来源:loss.py

示例2: match_targets_to_proposals

# 需要导入模块: from maskrcnn_benchmark.structures import boxlist_ops [as 别名]
# 或者: from maskrcnn_benchmark.structures.boxlist_ops import boxlist_iou [as 别名]
def match_targets_to_proposals(self, proposal, target):
        match_quality_matrix = boxlist_iou(target, proposal)
        matched_idxs = self.proposal_matcher(match_quality_matrix)
        # Fast RCNN only need "labels" field for selecting the targets
        target = target.copy_with_fields("labels")
        # get the targets corresponding GT for each proposal
        # NB: need to clamp the indices because we can have a single
        # GT in the image, and matched_idxs can be -2, which goes
        # out of bounds
        matched_targets = target[matched_idxs.clamp(min=0)]
        matched_targets.add_field("matched_idxs", matched_idxs)
        return matched_targets 
开发者ID:Res2Net,项目名称:Res2Net-maskrcnn,代码行数:14,代码来源:loss.py

示例3: match_targets_to_proposals

# 需要导入模块: from maskrcnn_benchmark.structures import boxlist_ops [as 别名]
# 或者: from maskrcnn_benchmark.structures.boxlist_ops import boxlist_iou [as 别名]
def match_targets_to_proposals(self, proposal, target):
        match_quality_matrix = boxlist_iou(target, proposal)
        matched_idxs = self.proposal_matcher(match_quality_matrix)
        # Keypoint RCNN needs "labels" and "keypoints "fields for creating the targets
        target = target.copy_with_fields(["labels", "keypoints"])
        # get the targets corresponding GT for each proposal
        # NB: need to clamp the indices because we can have a single
        # GT in the image, and matched_idxs can be -2, which goes
        # out of bounds
        matched_targets = target[matched_idxs.clamp(min=0)]
        matched_targets.add_field("matched_idxs", matched_idxs)
        return matched_targets 
开发者ID:Res2Net,项目名称:Res2Net-maskrcnn,代码行数:14,代码来源:loss.py

示例4: match_targets_to_proposals

# 需要导入模块: from maskrcnn_benchmark.structures import boxlist_ops [as 别名]
# 或者: from maskrcnn_benchmark.structures.boxlist_ops import boxlist_iou [as 别名]
def match_targets_to_proposals(self, proposal, target):
        match_quality_matrix = boxlist_iou(target, proposal)
        matched_idxs = self.proposal_matcher(match_quality_matrix)
        # Mask RCNN needs "labels" and "masks "fields for creating the targets
        target = target.copy_with_fields(["labels", "masks"])
        # get the targets corresponding GT for each proposal
        # NB: need to clamp the indices because we can have a single
        # GT in the image, and matched_idxs can be -2, which goes
        # out of bounds
        matched_targets = target[matched_idxs.clamp(min=0)]
        matched_targets.add_field("matched_idxs", matched_idxs)
        return matched_targets 
开发者ID:Res2Net,项目名称:Res2Net-maskrcnn,代码行数:14,代码来源:loss.py

示例5: match_targets_to_anchors

# 需要导入模块: from maskrcnn_benchmark.structures import boxlist_ops [as 别名]
# 或者: from maskrcnn_benchmark.structures.boxlist_ops import boxlist_iou [as 别名]
def match_targets_to_anchors(self, anchor, target, copied_fields=[]):
        match_quality_matrix = boxlist_iou(target, anchor)
        matched_idxs = self.proposal_matcher(match_quality_matrix)
        # RPN doesn't need any fields from target
        # for creating the labels, so clear them all
        target = target.copy_with_fields(copied_fields)
        # get the targets corresponding GT for each anchor
        # NB: need to clamp the indices because we can have a single
        # GT in the image, and matched_idxs can be -2, which goes
        # out of bounds
        matched_targets = target[matched_idxs.clamp(min=0)]
        matched_targets.add_field("matched_idxs", matched_idxs)
        return matched_targets 
开发者ID:Res2Net,项目名称:Res2Net-maskrcnn,代码行数:15,代码来源:loss.py

示例6: match_targets_to_anchors

# 需要导入模块: from maskrcnn_benchmark.structures import boxlist_ops [as 别名]
# 或者: from maskrcnn_benchmark.structures.boxlist_ops import boxlist_iou [as 别名]
def match_targets_to_anchors(self, anchor, target):
        match_quality_matrix = boxlist_iou(target, anchor)
        matched_idxs = self.proposal_matcher(match_quality_matrix)
        # RPN doesn't need any fields from target
        # for creating the labels, so clear them all
        target = target.copy_with_fields([])
        # get the targets corresponding GT for each anchor
        # NB: need to clamp the indices because we can have a single
        # GT in the image, and matched_idxs can be -2, which goes
        # out of bounds
        matched_targets = target[matched_idxs.clamp(min=0)]
        matched_targets.add_field("matched_idxs", matched_idxs)
        return matched_targets 
开发者ID:clw5180,项目名称:remote_sensing_object_detection_2019,代码行数:15,代码来源:loss.py


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