本文整理汇总了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
示例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
示例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
示例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
示例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
示例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