Fix extra dim for depth, matches rgb output shape.
PiperOrigin-RevId: 878098932 Change-Id: Ifcc4ba39dbee1beeea88fda44c3d20b88179705e
This commit is contained in:
committed by
Copybara-Service
parent
490c1f4126
commit
a8d6b0c848
@@ -110,4 +110,4 @@ def get_depth(
|
|||||||
)
|
)
|
||||||
|
|
||||||
depth = jnp.clip(raw / depth_scale, 0.0, 1.0)
|
depth = jnp.clip(raw / depth_scale, 0.0, 1.0)
|
||||||
return depth.reshape(height, width)
|
return depth.reshape(height, width, 1)
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class RenderUtilTest(absltest.TestCase):
|
|||||||
rc, 0, depth_data, 5.0
|
rc, 0, depth_data, 5.0
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(depth.shape, (height, width))
|
self.assertEqual(depth.shape, (height, width, 1))
|
||||||
|
|
||||||
def test_get_depth_vmap(self):
|
def test_get_depth_vmap(self):
|
||||||
nworld, width, height = 3, 4, 4
|
nworld, width, height = 3, 4, 4
|
||||||
@@ -111,7 +111,7 @@ class RenderUtilTest(absltest.TestCase):
|
|||||||
static_argnums=(0, 1, 3),
|
static_argnums=(0, 1, 3),
|
||||||
)(rc, 0, depth_data, 5.0)
|
)(rc, 0, depth_data, 5.0)
|
||||||
|
|
||||||
self.assertEqual(depth.shape, (nworld, height, width))
|
self.assertEqual(depth.shape, (nworld, height, width, 1))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user