Spaces:
Paused
Paused
dylanebert
commited on
Commit
·
fa9c639
1
Parent(s):
ddefedb
correct final rotation
Browse files- convert.py +6 -0
convert.py
CHANGED
|
@@ -420,6 +420,12 @@ class Converter(nn.Module):
|
|
| 420 |
vertices = (self.v + self.deform).detach().cpu().numpy()
|
| 421 |
triangles = self.f.detach().cpu().numpy()
|
| 422 |
vertices, triangles = clean_mesh(vertices, triangles, remesh=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 423 |
self.v = torch.from_numpy(vertices).contiguous().float().to(self.device)
|
| 424 |
self.f = torch.from_numpy(triangles).contiguous().int().to(self.device)
|
| 425 |
self.deform = nn.Parameter(torch.zeros_like(self.v).to(self.device))
|
|
|
|
| 420 |
vertices = (self.v + self.deform).detach().cpu().numpy()
|
| 421 |
triangles = self.f.detach().cpu().numpy()
|
| 422 |
vertices, triangles = clean_mesh(vertices, triangles, remesh=False)
|
| 423 |
+
|
| 424 |
+
rotation_matrix = np.array(
|
| 425 |
+
[[1, 0, 0], [0, -1, 0], [0, 0, -1]], dtype=np.float32
|
| 426 |
+
)
|
| 427 |
+
vertices = vertices @ rotation_matrix.T
|
| 428 |
+
|
| 429 |
self.v = torch.from_numpy(vertices).contiguous().float().to(self.device)
|
| 430 |
self.f = torch.from_numpy(triangles).contiguous().int().to(self.device)
|
| 431 |
self.deform = nn.Parameter(torch.zeros_like(self.v).to(self.device))
|