@@ -97,7 +97,6 @@ def _init_viewer(
9797
9898 def render_scene (
9999 self ,
100- scene_token : str ,
101100 * ,
102101 max_time_seconds : float = np .inf ,
103102 future_seconds : float = 0.0 ,
@@ -106,7 +105,6 @@ def render_scene(
106105 """Render specified scene.
107106
108107 Args:
109- scene_token (str): Unique identifier of scene.
110108 max_time_seconds (float, optional): Max time length to be rendered [s].
111109 future_seconds (float, optional): Future time in [s].
112110 save_dir (str | None, optional): Directory path to save the recording.
@@ -132,7 +130,7 @@ def render_scene(
132130 render3d = len (first_lidar_tokens ) > 0 or len (first_radar_tokens ) > 0
133131 render2d = len (first_camera_tokens ) > 0
134132
135- app_id = f"scene@{ scene_token } "
133+ app_id = f"scene@{ self . _t4 . dataset_id } "
136134 viewer = self ._init_viewer (
137135 app_id ,
138136 render3d = render3d ,
@@ -141,7 +139,7 @@ def render_scene(
141139 save_dir = save_dir ,
142140 )
143141
144- scene : Scene = self ._t4 .get ( " scene" , scene_token )
142+ scene : Scene = self ._t4 .scene [ 0 ]
145143 first_sample : Sample = self ._t4 .get ("sample" , scene .first_sample_token )
146144 max_timestamp_us = first_sample .timestamp + sec2us (max_time_seconds )
147145
@@ -212,7 +210,6 @@ def render_instance(
212210 if last_sample is None or current_last_sample .timestamp > last_sample .timestamp :
213211 last_sample = current_last_sample
214212
215- scene_token = first_sample .scene_token
216213 max_timestamp_us = last_sample .timestamp
217214
218215 # search first sample data tokens
@@ -235,7 +232,7 @@ def render_instance(
235232 render3d = len (first_lidar_tokens ) > 0 or len (first_radar_tokens ) > 0
236233 render2d = len (first_camera_tokens ) > 0
237234
238- app_id = f"instance@{ scene_token } "
235+ app_id = f"instance@{ self . _t4 . dataset_id } "
239236 viewer = self ._init_viewer (
240237 app_id ,
241238 render3d = render3d ,
@@ -279,7 +276,6 @@ def render_instance(
279276
280277 def render_pointcloud (
281278 self ,
282- scene_token : str ,
283279 * ,
284280 max_time_seconds : float = np .inf ,
285281 ignore_distortion : bool = True ,
@@ -288,7 +284,6 @@ def render_pointcloud(
288284 """Render pointcloud on 3D and 2D view.
289285
290286 Args:
291- scene_token (str): Scene token.
292287 max_time_seconds (float, optional): Max time length to be rendered [s].
293288 ignore_distortion (bool, optional): Whether to ignore distortion parameters.
294289 save_dir (str | None, optional): Directory path to save the recording.
@@ -298,7 +293,7 @@ def render_pointcloud(
298293 Add an option of rendering radar channels.
299294 """
300295 # initialize viewer
301- app_id = f"pointcloud@{ scene_token } "
296+ app_id = f"pointcloud@{ self . _t4 . dataset_id } "
302297 viewer = self ._init_viewer (app_id , render_ann = False , save_dir = save_dir )
303298
304299 # search first lidar sample data token
0 commit comments