占坑
由两分支组成:检测分支和分割分支组成;
1) roi_heads.append(("keypoint", build_roi_keypoint_head(cfg, in_channels)))
2) roi_heads = CombinedROIHeads(cfg, roi_heads)
1)build_roi_keypoint_head可查看modeling\roi_heads\keypoint_head\keypoint_head.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
from .box_head.box_head import build_roi_box_head
from .mask_head.mask_head import build_roi_mask_head
from .keypoint_head.keypoint_head import build_roi_keypoint_head
class CombinedROIHeads(torch.nn.ModuleDict):
"""
Combines a set of individual heads (for box prediction or masks) into a single
head.
"""
def __init__(self, cfg, heads):
super(CombinedROIHeads, self).__init__(heads)
self.cfg = cfg.clone()
if cfg.MO