pose encoder model

This commit is contained in:
2023-05-09 23:05:07 +00:00
parent 3f60403167
commit a8647951aa
5 changed files with 288 additions and 93 deletions
+4 -4
View File
@@ -35,14 +35,14 @@ class PoseRenderer(Module):
super().__init__()
colors = np.load('custom_data/pose_colors.npy')
self.textures = TexturesVertex(verts_features=torch.from_numpy(colors).to(device)[None, :, :])
self.cam = torch.tensor([5.0, 0.0, 0.0], device=device).cpu().numpy()
self.cam = torch.tensor([3.0, 0.0, 0.0], device=device).cpu().numpy()
def forward(self, verts: torch.Tensor, faces: torch.Tensor):
cameras, K = get_camera(self.cam, [480, 640], verts.get_device())
cameras, K = get_camera(self.cam, [512, 512], verts.get_device(), res_x=512, res_y=512)
raster_settings = RasterizationSettings(
image_size=(480, 640),
image_size=(512, 512),
blur_radius=0.0,
faces_per_pixel=1,
bin_size=0
@@ -63,7 +63,7 @@ if __name__ == '__main__':
smpl = SMPL(path='superSMPL', device='cuda')
pose = torch.zeros((1,72), device='cuda')
# generate random pose
pose[:,3:] = torch.randn((1,69), device='cuda') * 0.1
# pose[:,3:] = torch.randn((1,69), device='cuda') * 0.1
body, _ = smpl(pose, torch.zeros((1,11), device='cuda'), remove=False)
colors = np.zeros((body.shape[1], 3))