doubleheadsrcnn
doubleheadsrcnn copied to clipboard
model layers about conv_head and fc_head
In roi_box_predictors.py, I didn't find the code of conv_head layers, it seems that there is only fc_head layer. Can you tell me where I can find these two heads code. Thanks a lot.
class FPNPredictorNeighbor(nn.Module):
def __init__(self, cfg):
super(FPNPredictorNeighbor, self).__init__()
num_classes = cfg.MODEL.ROI_BOX_HEAD.NUM_CLASSES
representation_size = cfg.MODEL.ROI_BOX_HEAD.NONLOCAL_OUT_CHANNELS
self.cls_score = nn.Linear(representation_size, num_classes)
num_bbox_reg_classes = 2 if cfg.MODEL.CLS_AGNOSTIC_BBOX_REG else num_classes
self.bbox_pred = nn.Linear(representation_size, num_bbox_reg_classes * 4)
nn.init.normal_(self.cls_score.weight, std=0.01)
nn.init.normal_(self.bbox_pred.weight, std=0.001)
for l in [self.cls_score, self.bbox_pred]:
nn.init.constant_(l.bias, 0)
## fc layer
representation_size_fc = cfg.MODEL.ROI_BOX_HEAD.MLP_HEAD_DIM
self.cls_score_fc = nn.Linear(representation_size_fc, num_classes)
self.bbox_pred_fc = nn.Linear(representation_size_fc, num_bbox_reg_classes * 4)
nn.init.normal_(self.cls_score_fc.weight, std=0.01)
nn.init.normal_(self.bbox_pred_fc.weight, std=0.001)
for l in [self.cls_score_fc, self.bbox_pred_fc]:
nn.init.constant_(l.bias, 0)