raybundle input to ImplicitFunctions -> api unification

Summary: Currently some implicit functions in implicitron take a raybundle, others take ray_points_world. raybundle is what they really need. However, the raybundle is going to become a bit more flexible later, as it will contain different numbers of rays for each camera.

Reviewed By: bottler

Differential Revision: D39173751

fbshipit-source-id: ebc038e426d22e831e67a18ba64655d8a61e1eb9
This commit is contained in:
Darijan Gudelj
2022-09-05 06:26:06 -07:00
committed by Facebook GitHub Bot
parent 70dc9c451a
commit 72c3a0ebe5
9 changed files with 60 additions and 19 deletions

View File

@@ -44,7 +44,7 @@ class TestSRN(TestCaseMixin, unittest.TestCase):
implicit_function = SRNImplicitFunction()
device = torch.device("cpu")
bundle = self._get_bundle(device=device)
rays_densities, rays_colors = implicit_function(bundle)
rays_densities, rays_colors = implicit_function(ray_bundle=bundle)
out_features = implicit_function.raymarch_function.out_features
self.assertEqual(
rays_densities.shape,
@@ -62,7 +62,9 @@ class TestSRN(TestCaseMixin, unittest.TestCase):
implicit_function.to(device)
global_code = torch.rand(_BATCH_SIZE, latent_dim_hypernet, device=device)
bundle = self._get_bundle(device=device)
rays_densities, rays_colors = implicit_function(bundle, global_code=global_code)
rays_densities, rays_colors = implicit_function(
ray_bundle=bundle, global_code=global_code
)
out_features = implicit_function.hypernet.out_features
self.assertEqual(
rays_densities.shape,