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:
Christoph Lassner
2020-11-04 09:53:19 -08:00
committed by Facebook GitHub Bot
parent e9a26f263a
commit b6be3b95fb
9 changed files with 569 additions and 448 deletions

View File

@@ -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")
# )

View File

@@ -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)