@@ -38,7 +38,7 @@ def __init__(
3838 self .camera_name = self .config .il .camera_name
3939
4040 self .lerobot_as_lmdb = LerobotAsLmdb (self .lerobot_features_dir )
41- self .lmdb_keys = self .lerobot_as_lmdb .get_all_keys (allow_scan_list = ['r2r' ]) # r2r / r2r_aliengo / r2r_flash
41+ self .lmdb_keys = self .lerobot_as_lmdb .get_all_keys (allow_scan_list = ['r2r' ]) # r2r / r2r_aliengo / r2r_flash
4242 self .length = len (self .lmdb_keys )
4343 print (f"total keys in traj_data: { len (self .lmdb_keys )} " )
4444
@@ -106,14 +106,12 @@ def _load_next(self):
106106 data ['camera_info' ][self .camera_name ]['rgb' ] = data ['camera_info' ][self .camera_name ]['rgb' ][
107107 :- drop_last_frame_nums
108108 ]
109- data ['camera_info' ][self .camera_name ]['depth' ] = data ['camera_info' ][self .camera_name ][
110- 'depth'
111- ][:- drop_last_frame_nums ]
112- data ['robot_info' ]['yaw' ] = data ['robot_info' ]['yaw' ][:- drop_last_frame_nums ]
113- data ['robot_info' ]['position' ] = data ['robot_info' ]['position' ][:- drop_last_frame_nums ]
114- data ['robot_info' ]['orientation' ] = data ['robot_info' ]['orientation' ][
109+ data ['camera_info' ][self .camera_name ]['depth' ] = data ['camera_info' ][self .camera_name ]['depth' ][
115110 :- drop_last_frame_nums
116111 ]
112+ data ['robot_info' ]['yaw' ] = data ['robot_info' ]['yaw' ][:- drop_last_frame_nums ]
113+ data ['robot_info' ]['position' ] = data ['robot_info' ]['position' ][:- drop_last_frame_nums ]
114+ data ['robot_info' ]['orientation' ] = data ['robot_info' ]['orientation' ][:- drop_last_frame_nums ]
117115 data ['progress' ] = data ['progress' ][:- drop_last_frame_nums ]
118116 data ['step' ] = data ['step' ][:- drop_last_frame_nums ]
119117 if 'rgb_features' in data .keys ():
@@ -133,13 +131,11 @@ def _load_next(self):
133131
134132 if self .bert_tokenizer is not None :
135133 instructions = [
136- episodes_in_json [ep_idx ]['instruction_text' ]
137- for ep_idx in range (len (episodes_in_json ))
134+ episodes_in_json [ep_idx ]['instruction_text' ] for ep_idx in range (len (episodes_in_json ))
138135 ]
139136 else :
140137 instructions = [
141- episodes_in_json [ep_idx ]['instruction_tokens' ]
142- for ep_idx in range (len (episodes_in_json ))
138+ episodes_in_json [ep_idx ]['instruction_tokens' ] for ep_idx in range (len (episodes_in_json ))
143139 ]
144140 for instruction in instructions :
145141 new_data = self ._create_new_data (data , yaws , instruction )
0 commit comments