本文整理汇总了Python中detectron.utils.keypoints.heatmaps_to_keypoints方法的典型用法代码示例。如果您正苦于以下问题:Python keypoints.heatmaps_to_keypoints方法的具体用法?Python keypoints.heatmaps_to_keypoints怎么用?Python keypoints.heatmaps_to_keypoints使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类detectron.utils.keypoints
的用法示例。
在下文中一共展示了keypoints.heatmaps_to_keypoints方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: keypoint_results
# 需要导入模块: from detectron.utils import keypoints [as 别名]
# 或者: from detectron.utils.keypoints import heatmaps_to_keypoints [as 别名]
def keypoint_results(cls_boxes, pred_heatmaps, ref_boxes):
num_classes = cfg.MODEL.NUM_CLASSES
cls_keyps = [[] for _ in range(num_classes)]
person_idx = keypoint_utils.get_person_class_index()
xy_preds = keypoint_utils.heatmaps_to_keypoints(pred_heatmaps, ref_boxes)
# NMS OKS
if cfg.KRCNN.NMS_OKS:
keep = keypoint_utils.nms_oks(xy_preds, ref_boxes, 0.3)
xy_preds = xy_preds[keep, :, :]
ref_boxes = ref_boxes[keep, :]
pred_heatmaps = pred_heatmaps[keep, :, :, :]
cls_boxes[person_idx] = cls_boxes[person_idx][keep, :]
kps = [xy_preds[i] for i in range(xy_preds.shape[0])]
cls_keyps[person_idx] = kps
return cls_keyps