added skinning

This commit is contained in:
2022-06-22 23:02:31 +00:00
parent cf4b67c5a7
commit 0e88eb341c
13 changed files with 765 additions and 48 deletions
+2 -2
View File
@@ -124,7 +124,7 @@ def collision_loss(V, B, mask, thr=.004):
D = V - tf.gather_nd(B, idx)
b_vn = tf.gather_nd(B_vn, idx)
dot = tf.einsum('abc,abc->ab', D, b_vn)
loss = tf.reduce_mean((tf.minimum(dot - thr, 0) * mask) ** 2)
loss = tf.reduce_sum((tf.minimum(dot - thr, 0) * mask) ** 2) / tf.reduce_sum(mask)
return loss
@@ -147,7 +147,7 @@ def edge_loss(x, y, mask):
y_e = tf.sqrt(y_e + 1e-9)
d_e = y_e - x_e
d_e = d_e * e_mask
loss = tf.reduce_mean(d_e ** 2)
loss = tf.reduce_sum(d_e ** 2) / tf.reduce_sum(e_mask)
return loss