@@ -51,7 +51,7 @@ def compute_metadata(self, env_name: str, data_dir: str) -> EnvMetadata:
5151 egomotion_dir = Path (self .data_dir ) / "labels" / "egomotion"
5252 if not egomotion_dir .exists ():
5353 raise FileNotFoundError (
54- f"Expected PAI egomotion directory at { egomotion_dir } ."
54+ f"Expected PhysicalAI-AV egomotion directory at { egomotion_dir } ."
5555 )
5656
5757 clip_dir : Dict [str , str ] = {}
@@ -85,7 +85,7 @@ def compute_metadata(self, env_name: str, data_dir: str) -> EnvMetadata:
8585 self .clip_duration = clip_duration
8686
8787 clip_items = list (clip_dir .items ())
88- random .shuffle (clip_items )
88+ random .Random ( 42 ). shuffle (clip_items )
8989 self .clip_dir = dict (clip_items )
9090
9191 all_clips = [clip_id for clip_id , _ in clip_items ]
@@ -199,7 +199,7 @@ def _load_ego_df(scene_path: str) -> pd.DataFrame:
199199 return pd .read_parquet (scene_path )
200200
201201 @staticmethod
202- def get_df_from_path (
202+ def get_ego_df_from_path (
203203 scene_path : str ,
204204 scene_name : str ,
205205 verbose : bool = False ,
@@ -243,24 +243,10 @@ def get_df_from_path(
243243 elif all (key in ego_df .columns for key in prefixed_map .keys ()):
244244 normalized = ego_df .rename (columns = prefixed_map ).copy ()
245245 else :
246+ expected_cols = [* col_map .keys (), * prefixed_map .keys ()]
246247 missing = [
247248 key
248- for key in [
249- "x" ,
250- "y" ,
251- "z" ,
252- "qx" ,
253- "qy" ,
254- "qz" ,
255- "qw" ,
256- "EgomotionEstimate.location.x" ,
257- "EgomotionEstimate.location.y" ,
258- "EgomotionEstimate.location.z" ,
259- "EgomotionEstimate.orientation.x" ,
260- "EgomotionEstimate.orientation.y" ,
261- "EgomotionEstimate.orientation.z" ,
262- "EgomotionEstimate.orientation.w" ,
263- ]
249+ for key in expected_cols
264250 if key not in ego_df .columns
265251 ]
266252 raise KeyError (
@@ -359,7 +345,7 @@ def _interp(col_name: str) -> np.ndarray:
359345 def get_agent_info (
360346 self , scene : Scene , cache_path : Path , cache_class : Type [SceneCache ]
361347 ) -> Tuple [List [AgentMetadata ], List [List [AgentMetadata ]]]:
362- ego_df = self .get_df_from_path (self .clip_dir [scene .name ], scene .name )
348+ ego_df = self .get_ego_df_from_path (self .clip_dir [scene .name ], scene .name )
363349 ego_df .set_index (["agent_id" , "scene_ts" ], inplace = True )
364350
365351 ego_metadata = AgentMetadata (
0 commit comments