1. add back map center to restore original coordinate in nuScnes (#51)
* 1. add back map center to restore the original coordinate in nuScenes
This commit is contained in:
@@ -485,6 +485,16 @@ def convert_nuscenes_scenario(
|
|||||||
}
|
}
|
||||||
# map
|
# map
|
||||||
result[SD.MAP_FEATURES] = get_map_features(scene_info, nuscenes, map_center, map_radius, only_lane=only_lane)
|
result[SD.MAP_FEATURES] = get_map_features(scene_info, nuscenes, map_center, map_radius, only_lane=only_lane)
|
||||||
|
# add back map center
|
||||||
|
map_center = map_center[np.newaxis]
|
||||||
|
for k, v in result[SD.TRACKS].items():
|
||||||
|
v['state']['position'] += map_center
|
||||||
|
|
||||||
|
for k, v in result[SD.MAP_FEATURES].items():
|
||||||
|
if 'polygon' in v:
|
||||||
|
v['polygon'] += map_center[:, :v['polygon'].shape[-1]]
|
||||||
|
else:
|
||||||
|
v['polyline'] += map_center[:, :v['polyline'].shape[-1]]
|
||||||
del frames_scene_info
|
del frames_scene_info
|
||||||
del frames
|
del frames
|
||||||
del scene_info
|
del scene_info
|
||||||
|
|||||||
Reference in New Issue
Block a user