Skip to content

Commit 5e287ed

Browse files
committed
[fix] fix pre commit
1 parent afafc4b commit 5e287ed

5 files changed

Lines changed: 108 additions & 105 deletions

File tree

docs/compatibility.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ The training pipeline now uses the new key name:
1010
- `instruction_text``task`
1111

1212
The updated conversion logic is **not compatible** with InternData-N1 `v0.1`.
13-

internnav/dataset/cma_lerobot_dataset.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

internnav/dataset/rdp_lerobot_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def __init__(
103103
self.to_pil = ToPILImage()
104104
self.image_processor = _transform(n_px=224) # copy from clip-long
105105
self.lerobot_as_lmdb = LerobotAsLmdb(self.lerobot_features_dir)
106-
self.lmdb_keys = self.lerobot_as_lmdb.get_all_keys(allow_scan_list=['r2r']) # r2r / r2r_aliengo / r2r_flash
106+
self.lmdb_keys = self.lerobot_as_lmdb.get_all_keys(allow_scan_list=['r2r']) # r2r / r2r_aliengo / r2r_flash
107107
self.length = len(self.lmdb_keys)
108108
print(f"total keys in traj_data: {len(self.lmdb_keys)}")
109109

internnav/habitat_extensions/vln/habitat_vln_evaluator.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ def __init__(self, cfg: EvalCfg):
107107
# ------------------------------------- model ------------------------------------------
108108
self.model_args = argparse.Namespace(**cfg.agent.model_settings)
109109
self.vis_debug = bool(getattr(self.model_args, "vis_debug", False))
110-
self.vis_debug_path = getattr(
111-
self.model_args, "vis_debug_path", os.path.join(self.output_path, "vis_debug")
112-
)
110+
self.vis_debug_path = getattr(self.model_args, "vis_debug_path", os.path.join(self.output_path, "vis_debug"))
113111

114112
processor = AutoProcessor.from_pretrained(self.model_args.model_path)
115113
processor.tokenizer.padding_side = 'left'
@@ -261,7 +259,7 @@ def resume_from_output_path(self) -> None:
261259
ndtw.append(res['ndtw'])
262260
return sucs, spls, oss, nes, ndtw
263261

264-
def _run_eval_dual_system(self) -> tuple:
262+
def _run_eval_dual_system(self) -> tuple: # noqa: C901
265263
self.model.eval()
266264

267265
# resume from previous results
@@ -554,9 +552,7 @@ def _run_eval_dual_system(self) -> tuple:
554552
)
555553
if pixel_goal is not None:
556554
if draw_pixel_goal:
557-
cv2.circle(
558-
vis, (pixel_goal[0], pixel_goal[1]), radius=8, color=(255, 0, 0), thickness=-1
559-
)
555+
cv2.circle(vis, (pixel_goal[0], pixel_goal[1]), radius=8, color=(255, 0, 0), thickness=-1)
560556
vis_writer.append_data(vis)
561557

562558
if action == action_code.LOOKDOWN:

0 commit comments

Comments
 (0)