lyft / nuscenes-devkit

Devkit for the public 2019 Lyft Level 5 AV Dataset (fork of https://github.com/nutonomy/nuscenes-devkit)
Other
365 stars 103 forks source link

Reference Model.ipynb: get_semantic_map_around_ego: IndexError: tuple index out of range #69

Closed BoPengGit closed 4 years ago

BoPengGit commented 4 years ago

Hi,

In Reference Model.ipynb, Cell [12]: function: get_semantic_map_around_ego(): When I run the line

ego_centric_map = get_semantic_map_around_ego(map_mask, ego_pose, voxel_size=0.4, output_shape=(336,336)) I get indexError: tuple index out of range

`--------------------------------------------------------------------------- IndexError Traceback (most recent call last)

in 32 return ego_centric_map.astype(np.float32)/255 33 ---> 34 ego_centric_map = get_semantic_map_around_ego(map_mask, ego_pose, voxel_size=0.4, output_shape=(336,336)) 35 plt.imshow(ego_centric_map) 36 plt.show() in get_semantic_map_around_ego(map_mask, ego_pose, voxel_size, output_shape) 14 return cropped_image 15 ---> 16 pixel_coords = map_mask.to_pixel_coords(ego_pose['translation'][0], ego_pose['translation'][1]) 17 18 extent = voxel_size*output_shape[0]*0.5 ~/anaconda3/lib/python3.7/site-packages/lyft_dataset_sdk/utils/map_mask.py in to_pixel_coords(self, x, y) 97 98 pts = np.stack([x, y, np.zeros(x.shape), np.ones(x.shape)]) ---> 99 pixel_coords = np.round(np.dot(self.transform_matrix, pts)).astype(np.int32) 100 101 return pixel_coords[0, :], pixel_coords[1, :] ~/anaconda3/lib/python3.7/site-packages/lyft_dataset_sdk/utils/map_mask.py in transform_matrix(self) 53 [ 54 [1.0 / self.resolution, 0, 0, 0], ---> 55 [0, -1.0 / self.resolution, 0, self._base_mask.shape[0]], 56 [0, 0, 1, 0], 57 [0, 0, 0, 1], IndexError: tuple index out of range`

Thank you,

God bless.

BoPengGit commented 4 years ago

Nevermind, when I restarted the notebook, it worked fine.

Thank you.