반응형
'''
x : forward direction
y : side (left) direction
'''
s, b, c, h, w = seq_z.size()
h_meters = self.cfg['bev']['h_meters']
w_meters = self.cfg['bev']['w_meters']
h_grid = torch.linspace(0, h_meters, h) - (h_meters / 2)
w_grid = torch.linspace(0, w_meters, w) - (w_meters / 2)
grid_x, grid_y = torch.meshgrid(torch.flip(h_grid, dims=(0,)), torch.flip(w_grid, dims=(0,)), indexing='ij')
grid = torch.stack((grid_x, grid_y), dim=0)
grid = F.pad(grid, (0, 0, 0, 0, 0, 1), value=1.0).unsqueeze(0) # b 3 h w
'Deep Learning' 카테고리의 다른 글
Torch.Tensor can generate 'nan' elements (0) | 2023.05.19 |
---|---|
Pytorch DDP (Distributed Data Parallel) 사용 관련 웹페이지 모음 (0) | 2023.05.16 |
Nuscenes Warping Test Code (0) | 2023.04.12 |
einops으로 pytorch의 차원관리 예제 (0) | 2023.04.10 |
nuScenes devkit 명령어 모음 (useful commands) (0) | 2023.04.03 |