Experimental glTF reading

Summary: Experimental data loader for taking the default scene from a GLB file and converting it to a single mesh in PyTorch3D.

Reviewed By: nikhilaravi

Differential Revision: D25900167

fbshipit-source-id: bff22ac00298b83a0bd071ae5c8923561e1d81d7
This commit is contained in:
Jeremy Reizenstein
2021-05-26 04:52:46 -07:00
committed by Facebook GitHub Bot
parent 0e85652f07
commit ed6983ea84
9 changed files with 771 additions and 3 deletions

View File

@@ -155,7 +155,7 @@ class TestCaseMixin(unittest.TestCase):
)
if not close and msg is None:
diff = backend.abs(input - other) + 0.0
diff = backend.abs(input + 0.0 - other)
ratio = diff / backend.abs(other)
try_relative = (diff <= atol) | (backend.isfinite(ratio) & (ratio > 0))
if try_relative.all():
@@ -167,7 +167,9 @@ class TestCaseMixin(unittest.TestCase):
else:
extra = ""
shape = tuple(input.shape)
loc = np.unravel_index(diff.argmax(), shape)
max_diff = diff.max()
self.fail(f"Not close. Max diff {max_diff}.{extra} Shape {shape}.")
msg = f"Not close. Max diff {max_diff}.{extra} Shape {shape}. At {loc}."
self.fail(msg)
self.assertTrue(close, msg)