def __init__(self, skeleton, vertex_num):
     super(SkinRefineNet, self).__init__()
     self.joint_num = len(skeleton)
     self.vertex_num = vertex_num
     self.fc_pose = make_linear_layers(
         [self.joint_num * 3, 256, vertex_num * 3], relu_final=False)
     self.fc_id = make_linear_layers([cfg.id_code_dim, 256, vertex_num * 3],
                                     relu_final=False)
Beispiel #2
0
 def __init__(self, joint_num):
     super(ParamRegressor, self).__init__()
     self.joint_num = joint_num
     self.fc = make_linear_layers([self.joint_num * 3, 1024, 512],
                                  use_bn=True)
     self.fc_pose = make_linear_layers(
         [512, 24 * 6], relu_final=False)  # joint orientation
     self.fc_shape = make_linear_layers([512, 10],
                                        relu_final=False)  # shape parameter
 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)
Beispiel #4
0
 def __init__(self, joint_num):
     super(ParamRegressor, self).__init__()
     self.joint_num = joint_num
     self.fc = make_linear_layers([self.joint_num * 3, 1024, 512],
                                  use_bn=True)
     if 'FreiHAND' in cfg.trainset_3d + cfg.trainset_2d + [cfg.testset]:
         self.fc_pose = make_linear_layers(
             [512, 16 * 6], relu_final=False)  # hand joint orientation
     else:
         self.fc_pose = make_linear_layers(
             [512, 24 * 6], relu_final=False)  # body joint orientation
     self.fc_shape = make_linear_layers([512, 10],
                                        relu_final=False)  # shape parameter
Beispiel #5
0
 def __init__(self, class_num):
     super(Classifier, self).__init__()
     self.class_num = class_num
     if cfg.mode == 'rgb_only':
         self.fc = make_linear_layers(
             [cfg.resnet_feat_dim[cfg.img_resnet_type], self.class_num],
             relu_final=False)
     elif cfg.mode == 'pose_only':
         self.fc = make_linear_layers(
             [cfg.resnet_feat_dim[cfg.pose_resnet_type], self.class_num],
             relu_final=False)
     else:
         self.fc = make_linear_layers([cfg.agg_feat_dim, self.class_num],
                                      relu_final=False)
     self.dropout = nn.Dropout(0.5)
Beispiel #6
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, skeleton):
     super(PoseNet, self).__init__()
     self.joint_num = len(skeleton)
     self.register_buffer(
         'DoF',
         torch.cat([
             torch.from_numpy(skeleton[i]['DoF'])[None, :]
             for i in range(self.joint_num)
         ]).cuda().float())
     self.dof_num = int(torch.sum(self.DoF))
     self.fc = make_linear_layers(
         [cfg.backbone_img_feat_dim, 512, self.dof_num], relu_final=False)
 def __init__(self, skeleton):
     super(SkeletonRefineNet, self).__init__()
     self.joint_num = len(skeleton)
     self.fc_skeleton = make_linear_layers(
         [cfg.id_code_dim, 64, self.joint_num * 3], relu_final=False)
 def __init__(self):
     super(BackboneNet, self).__init__()
     self.resnet = ResNetBackbone(cfg.resnet_type)
     self.fc = make_linear_layers([2048, cfg.backbone_img_feat_dim])