Skip to content

Commit

Permalink
voxel: add grid floor
Browse files Browse the repository at this point in the history
  • Loading branch information
d4l3k committed Oct 19, 2023
1 parent b8fd677 commit d66858b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions autolabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def forward(self, img: torch.Tensor) -> torch.Tensor:

TASKS = [
LabelDet(),
# LabelSemSeg(),
LabelSemSeg(),
]


Expand Down Expand Up @@ -185,7 +185,8 @@ def get_task_path(task: nn.Module) -> str:
cam_data = {}
for cam, frames in batch.color.items():
squashed = frames[idxs].squeeze(1)
cam_data[cam] = task(squashed)
with torch.no_grad():
cam_data[cam] = task(squashed)

for j, i in enumerate(idxs):
frame_data = {}
Expand Down
7 changes: 7 additions & 0 deletions torchdrive/tasks/voxel.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ def forward(
)[:, 1:]

grid = grid.permute(0, 1, 4, 3, 2)

# set floor
# this helps avoid degenerate cases due to dynamic objects, blur and
# reflections
grid = grid.clone()
grid[:, :, :, :, 0] = 1

feat_grid = feat_grid.permute(0, 1, 4, 3, 2)
# agrid, _ = axis_grid(grid)
# grid = (grid+agrid).clamp(min=0, max=1)
Expand Down

0 comments on commit d66858b

Please sign in to comment.