示例#1
0
    def __init__(self):
        super(Aggregator, self).__init__()
        self.img_resnet_dim = cfg.resnet_feat_dim[cfg.img_resnet_type]
        self.pose_resnet_dim = cfg.resnet_feat_dim[cfg.pose_resnet_type]

        ## temporal strided conv to fuse with RGB
        self.pose_frame_num = (cfg.frame_per_seg -
                               1) * cfg.pose_frame_factor + 1
        self.pose_temporal_conv = make_conv3d_layers(
            [self.pose_resnet_dim, self.pose_resnet_dim],
            kernel=(5, 1, 1),
            stride=(cfg.pose_frame_factor, 1, 1),
            padding=(2, 0, 0))

        ## pose gate layer
        self.pose_gate_fc = make_linear_layers(
            [self.pose_resnet_dim, cfg.agg_feat_dim], relu_final=False)

        ## aggregation layer
        self.img_conv = make_conv_layers(
            [self.img_resnet_dim, cfg.agg_feat_dim], kernel=1, padding=0)
        self.img_norm = nn.LayerNorm([cfg.agg_feat_dim, 1, 1])
        self.pose_conv = make_conv_layers(
            [self.pose_resnet_dim, cfg.agg_feat_dim], kernel=1, padding=0)
        self.pose_norm = nn.LayerNorm([cfg.agg_feat_dim, 1, 1])
 def __init__(self, joint_num):
     super(PoseNet, self).__init__()
     self.joint_num = joint_num # single hand
     
     self.joint_deconv_1 = make_deconv_layers([2048,256,256,256])
     self.joint_conv_1 = make_conv_layers([256,self.joint_num*cfg.output_hm_shape[0]],kernel=1,stride=1,padding=0,bnrelu_final=False)
     self.joint_deconv_2 = make_deconv_layers([2048,256,256,256])
     self.joint_conv_2 = make_conv_layers([256,self.joint_num*cfg.output_hm_shape[0]],kernel=1,stride=1,padding=0,bnrelu_final=False)
     
     self.root_fc = make_linear_layers([2048,512,cfg.output_root_hm_shape],relu_final=False)
     self.hand_fc = make_linear_layers([2048,512,2],relu_final=False)
示例#3
0
 def __init__(self, joint_num):
     super(Pose2Feat, self).__init__()
     self.joint_num = joint_num
     self.conv = make_conv_layers(
         [64 + joint_num * cfg.output_hm_shape[0], 64])
示例#4
0
 def __init__(self, joint_num, skeleton):
     super(Pose2Feat, self).__init__()
     self.joint_num = joint_num
     self.skeleton_num = len(skeleton)
     self.conv = make_conv_layers(
         [self.joint_num + 2 * self.skeleton_num, 64])