fixed normalization, can overfit on single image

This commit is contained in:
2023-01-24 22:45:14 +00:00
parent a0f3e95255
commit d062c2068d
6 changed files with 147 additions and 72 deletions
+2 -2
View File
@@ -146,13 +146,13 @@ class DepthRenderer(nn.Module):
raster_settings=raster_settings
)
output = rasterizer(Meshes(verts[None,:,:], faces[None,:,:]))
v2i = cameras.transform_points_screen(verts).round().to(torch.long)[:,:2]
v2i = None #cameras.transform_points_screen(verts).round().to(torch.long)[:,:2]
depth = output.zbuf[0,:,:,0]
pix_to_face = output.pix_to_face[0,:,:,0]
mask = depth != -1
# dmin = depth.min()
dmean = depth[mask].mean()
# dmean = depth[mask].mean()
# dmax = depth[mask].max()
# depth[mask] = depth[mask] - dmean
# depth[~mask] = 0.0