Skip to content

Commit 470126e

Browse files
authored
Merge pull request #3 from TinyZeaMays/expose-motrix-y-up
Expose y_up option for Motrix renderers
2 parents a054e0a + 05ddd63 commit 470126e

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎src/gaussian_renderer/batch_splat.py‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,24 @@ def batch_env_render(
179179
width: int,
180180
fovy: np.ndarray,
181181
bg_imgs: Optional[Tensor] = None,
182+
y_up: bool = True,
182183
):
183184
"""Render RGBD for batch envs and cameras."""
184185
if not isinstance(cam_pos, torch.Tensor):
185186
cam_pos = torch.tensor(cam_pos, device=self.device, dtype=torch.float32)
186187
if not isinstance(cam_xmat, torch.Tensor):
187188
cam_xmat = torch.tensor(cam_xmat, device=self.device, dtype=torch.float32)
188-
return _batch_env_render(gsb, cam_pos, cam_xmat, height, width, fovy, bg_imgs=bg_imgs, minibatch=self.minibatch)
189+
return _batch_env_render(
190+
gsb,
191+
cam_pos,
192+
cam_xmat,
193+
height,
194+
width,
195+
fovy,
196+
bg_imgs=bg_imgs,
197+
minibatch=self.minibatch,
198+
y_up=y_up,
199+
)
189200

190201

191202
if TYPE_CHECKING:

‎src/gaussian_renderer/gs_renderer_motrixsim.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def render(
100100
width: int,
101101
height: int,
102102
system_camera: Optional[Any] = None,
103+
y_up: bool = True,
103104
) -> Dict[int, Tuple[Tensor, Tensor]]:
104105

105106
cam_pos_lst = []
@@ -122,7 +123,7 @@ def render(
122123
fovy_lst.append(mx_model.cameras[cid].fovy) # TODO: get actual fovy from MotrixSim camera
123124

124125
rgb_tensor, depth_tensor = self.render_batch(
125-
np.array(cam_pos_lst), np.array(cam_xmat_lst), height, width, np.array(fovy_lst)
126+
np.array(cam_pos_lst), np.array(cam_xmat_lst), height, width, np.array(fovy_lst), y_up=y_up
126127
)
127128

128129
batch_indices = {cid: i for i, cid in enumerate(cam_ids)}

0 commit comments

Comments
 (0)