Skip to content

Commit

Permalink
fix: empty depth stack
Browse files Browse the repository at this point in the history
  • Loading branch information
mosure committed Oct 31, 2024
1 parent eb24925 commit 67e2938
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ffi/python/bevy_zeroverse_dataloader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,11 @@ def __getitem__(self, idx):
depth_tensors.append(depth_tensor)

color_tensor = torch.stack(color_tensors, dim=0)
depth_tensor = torch.stack(depth_tensors, dim=0)

if len(depth_tensors) == 0:
depth_tensor = torch.zeros_like(color_tensor)
else:
depth_tensor = torch.stack(depth_tensors, dim=0)

meta_tensors['color'] = color_tensor
meta_tensors['depth'] = depth_tensor
Expand Down

0 comments on commit 67e2938

Please sign in to comment.