use original cloth3d functions

This commit is contained in:
2022-12-23 22:15:22 +00:00
parent 67891530a2
commit 156d7c0245
6 changed files with 506 additions and 10 deletions
+4 -3
View File
@@ -150,9 +150,9 @@ class DepthRenderer(nn.Module):
def forward(self, verts, faces, cam):
R, T = look_at_view_transform(2.7, 0, 0)
cameras = FoVPerspectiveCameras(device='cuda', R=R, T=T)
# cameras = FoVPerspectiveCameras(device='cuda', R=R, T=T)
ext = extrinsic(cam)
cameras = PerspectiveCameras(device='cuda', R=ext[None, :, :3], T=ext[None, :, 3], focal_length=50)
cameras = PerspectiveCameras(device='cuda', R=ext[None, :, :3], T=ext[None, :, 3])
raster_settings = RasterizationSettings(
image_size=512,
@@ -165,7 +165,8 @@ class DepthRenderer(nn.Module):
cameras=cameras,
raster_settings=raster_settings
)
depth = rasterizer(Meshes(verts[None,:,:], faces[None,:,:])).zbuf[0,:,:,0]
output = rasterizer(Meshes(verts[None,:,:], faces[None,:,:]))
depth = output.zbuf[0,:,:,0]
mask = depth != -1
# dmin = depth.min()