mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-19 22:00:35 +08:00
Example and test updates.
Summary: This commit performs pulsar example and test refinements. The examples are fully adjusted to adhere to PEP style guide and additional comments are added. Reviewed By: nikhilaravi Differential Revision: D24723391 fbshipit-source-id: 6d289006f080140159731e7f3a8c98b582164f1a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e9a26f263a
commit
b6be3b95fb
@@ -44,6 +44,8 @@ class TestDepth(TestCaseMixin, unittest.TestCase):
|
||||
n_channels=1,
|
||||
).to(device)
|
||||
data = torch.load(IN_REF_FP, map_location="cpu")
|
||||
# For creating the reference files.
|
||||
# Use in case of updates.
|
||||
# data["pos"] = torch.rand_like(data["pos"])
|
||||
# data["pos"][:, 0] = data["pos"][:, 0] * 2. - 1.
|
||||
# data["pos"][:, 1] = data["pos"][:, 1] * 2. - 1.
|
||||
@@ -74,6 +76,8 @@ class TestDepth(TestCaseMixin, unittest.TestCase):
|
||||
),
|
||||
depth_vis.cpu().numpy().astype(np.uint8),
|
||||
)
|
||||
# For creating the reference files.
|
||||
# Use in case of updates.
|
||||
# torch.save(
|
||||
# data, path.join(path.dirname(__file__), "reference", "nr0000-in.pth")
|
||||
# )
|
||||
|
||||
@@ -123,7 +123,7 @@ class TestSmallSpheres(unittest.TestCase):
|
||||
self.assertTrue(
|
||||
(sphere_ids == idx).sum() > 0, "Sphere ID %d missing!" % (idx)
|
||||
)
|
||||
# Visualize.
|
||||
# Visualization code. Activate for debugging.
|
||||
# result_im = (result.cpu().detach().numpy() * 255).astype(np.uint8)
|
||||
# cv2.imshow("res", result_im[0, :, :, ::-1])
|
||||
# cv2.waitKey(0)
|
||||
|
||||
Reference in New Issue
Block a user