def __init__(self, params_dict): super(VoxHonet, self).__init__(params_dict) self.voxel_grid_side = params_dict['voxel_grid_side'] self.load_pcls(params_dict['dataset_folder']) self.num_joints = 16 self.main_loss_conv = cudafy( VargoNet.VargoNetConvBlock(kernel_size=3, stride=1, filters=21, in_channels=256, padding=1), self.use_cuda) self.main_loss_deconv1 = cudafy( nn.Upsample(size=self.crop_res, mode='bilinear'), self.use_cuda) if self.cross_entropy: self.softmax_final = cudafy(VargoNet.SoftmaxLogProbability2D(), self.use_cuda) self.innerproduct1_joint1 = cudafy( nn.Linear(in_features=524288, out_features=200), self.use_cuda) self.innerproduct2_joint1 = cudafy( nn.Linear(in_features=200, out_features=(self.num_joints - 1) * 3), self.use_cuda) self.innerproduct1_joint2 = cudafy( nn.Linear(in_features=262144, out_features=200), self.use_cuda) self.innerproduct2_joint2 = cudafy( nn.Linear(in_features=200, out_features=(self.num_joints - 1) * 3), self.use_cuda) self.innerproduct1_joint3 = cudafy( nn.Linear(in_features=131072, out_features=200), self.use_cuda) self.innerproduct2_joint3 = cudafy( nn.Linear(in_features=200, out_features=(self.num_joints - 1) * 3), self.use_cuda) self.innerproduct1_joint_main = cudafy( nn.Linear(in_features=65536, out_features=200), self.use_cuda) self.innerproduct2_join_main = cudafy( nn.Linear(in_features=200, out_features=200), self.use_cuda) self.obj_voxel_in = cudafy( nn.Conv3d(in_channels=1, out_channels=1, kernel_size=6, stride=2), self.use_cuda) self.obj_conv3d0 = cudafy( nn.Conv3d(in_channels=1, out_channels=1, kernel_size=5, stride=2), self.use_cuda) self.obj_conv3d1 = cudafy( nn.Conv3d(in_channels=1, out_channels=1, kernel_size=5), self.use_cuda) self.funnel_in0 = cudafy( nn.Linear(in_features=200 + 216, out_features=100), self.use_cuda) self.funnel_in1 = cudafy(nn.Linear(in_features=100, out_features=100), self.use_cuda) self.funnel_in2 = cudafy( nn.Linear(in_features=100, out_features=(self.num_joints - 1) * 3), self.use_cuda)
def __init__(self, params_dict): super(HONet, self).__init__(params_dict) self.num_joints = 16 self.main_loss_conv = cudafy( VargoNet.VargoNetConvBlock(kernel_size=3, stride=1, filters=21, in_channels=256, padding=1), self.use_cuda) self.main_loss_deconv1 = cudafy( nn.Upsample(size=self.crop_res, mode='bilinear'), self.use_cuda) if self.cross_entropy: self.softmax_final = cudafy(VargoNet.SoftmaxLogProbability2D(), self.use_cuda) self.innerproduct1_joint1 = cudafy( nn.Linear(in_features=524288, out_features=200), self.use_cuda) self.innerproduct2_joint1 = cudafy( nn.Linear(in_features=200, out_features=(self.num_joints - 1) * 3), self.use_cuda) self.innerproduct1_joint2 = cudafy( nn.Linear(in_features=262144, out_features=200), self.use_cuda) self.innerproduct2_joint2 = cudafy( nn.Linear(in_features=200, out_features=(self.num_joints - 1) * 3), self.use_cuda) self.innerproduct1_joint3 = cudafy( nn.Linear(in_features=131072, out_features=200), self.use_cuda) self.innerproduct2_joint3 = cudafy( nn.Linear(in_features=200, out_features=(self.num_joints - 1) * 3), self.use_cuda) self.innerproduct1_joint_main = cudafy( nn.Linear(in_features=65536, out_features=200), self.use_cuda) self.innerproduct2_join_main = cudafy( nn.Linear(in_features=200, out_features=200), self.use_cuda) self.obj0 = cudafy( nn.Linear(in_features=self.size_obj_input, out_features=self.size_obj_input), self.use_cuda) self.obj1 = cudafy( nn.Linear(in_features=self.size_obj_input, out_features=self.size_obj_input), self.use_cuda) self.obj2 = cudafy( nn.Linear(in_features=self.size_obj_input, out_features=self.size_obj_input), self.use_cuda) self.merge_hand_obj = cudafy( nn.Linear(in_features=200 + self.size_obj_input, out_features=200 + self.size_obj_input), self.use_cuda) self.hand_obj0 = cudafy( nn.Linear(in_features=200 + self.size_obj_input, out_features=100), self.use_cuda) self.hand_obj1 = cudafy( nn.Linear(in_features=100, out_features=(self.num_joints - 1) * 3), self.use_cuda)
def map_out_conv(self, in_channels): return cudafy( VargoNet.VargoNetConvBlock(kernel_size=3, stride=1, filters=21, in_channels=in_channels, padding=1), self.use_cuda)