plotting not working, losses fixed?

This commit is contained in:
2022-06-10 15:32:25 +00:00
parent 31607cc754
commit 94e693d7f6
5 changed files with 108 additions and 54 deletions
+23 -1
View File
@@ -62,4 +62,26 @@ class UV2Mesh():
def __call__(self, uv):
return self.uv_to_mesh(uv)
def _maskFaces(V, F, mask):
V_mask = mask
F_mask = np.take(V_mask, F.reshape(-1), axis=0)
F_mask = F_mask.reshape((-1, 3)).sum(axis=1) == 3
V_ind = np.zeros(V_mask.shape)
V_ind[V_mask] = np.arange(V_mask.sum())
F_new = np.take(V_ind, F[F_mask, :].reshape(-1), axis=0).reshape((-1, 3))
V_new = V[V_mask, :]
return V_new, F_new
def maskFacesBatch(V, F, mask):
Vs = []
Fs = []
for i in range(mask.shape[0]):
v, f = _maskFaces(V[i], F, mask[i])
Vs.append(v)
Fs.append(f)
return Vs, Fs