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:
Alan
2024-01-18 22:47:15 +01:00
committed by GitHub
parent 46747d85aa
commit 1f61a4b9d1

View File

@@ -485,6 +485,16 @@ def convert_nuscenes_scenario(
}
# map
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
del scene_info