當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。