curvature training

This commit is contained in:
2023-04-08 00:43:08 +02:00
parent 52e5658dcc
commit cada175296
7 changed files with 309 additions and 13 deletions
+2 -2
View File
@@ -40,7 +40,7 @@ class UV2Mesh(nn.Module):
def uv_to_mesh(self, uv):
if uv.shape[1] == 3:
if uv.shape[1] == 3 or uv.shape[1] == 7:
uv = torch.permute(uv, [0,2,3,1])
if uv.shape[1] != 512:
uv = Resize(uv[:,:,None], size=(512, 256), interpolation=InterpolationMode.BILINEAR)
@@ -65,7 +65,7 @@ class UV2Mesh(nn.Module):
# p1 = tf.stack((x1, y1, z1), axis=-1)
# p2 = tf.stack((x2, y2, z2), axis=-1)
mesh = torch.mean(uv[:, self.uv_pixels[:,:,0], self.uv_pixels[:,:,1]], dim=2)
mesh = torch.mean(uv[:, self.uv_pixels[:,:,0], self.uv_pixels[:,:,1]].float(), dim=2)
return mesh