Skip to content

Commit 10c3f7d

Browse files
author
Haozhe Qi
committed
fixed a bug that invalidates base
1 parent e46eef1 commit 10c3f7d

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

llava/action/ek_eval.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ def collate_fn(batch):
342342
if eval_args.learn_neighbor_actions:
343343
from llava.action.generate_interval_pred import get_lookup_dict
344344
if eval_args.test_type.startswith('temporal_cot'):
345-
346345
lookup_table = get_lookup_dict(eval_args.val_metadata, test_type = eval_args.test_type, pseudo_folder = eval_args.pseudo_folder)
347346

348347

@@ -353,7 +352,7 @@ def collate_fn(batch):
353352
mc_data = mc_data[0]
354353
time_meta = time_meta[0]
355354

356-
if eval_args.learn_neighbor_actions:
355+
if eval_args.learn_neighbor_actions and lookup_table:
357356
_id = time_meta['vid_path']
358357
_id = _id.replace('/', '-')
359358
uid = f"{_id}_{time_meta['start_second']}_{time_meta['end_second']}"

llava/action/generate_interval_pred.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,13 @@ def get_lookup_dict(ann_file, test_type = 'base', delta = 3, pseudo_folder = Non
172172
'prev2_offset': round(start_times[i+2] - start_times[i],2),
173173
'prev1_narration': narration2,
174174
'prev1_offset': round(start_times[i+2] - start_times[i+1],2),
175-
'cur_narration': narration3}
175+
'cur_narration': narration3,
176+
'prev2_start': start_times[i],
177+
'prev2_end': end_times[i],
178+
'prev1_start': start_times[i+1],
179+
'prev1_end': end_times[i+1],
180+
'cur_start': start_times[i+2],
181+
'cur_end': end_times[i+2]}
176182
return table
177183

178184

llava/action/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,11 @@ def format_task_related_prompt(question, question_type, meta_data = None, perspe
254254
assert isinstance(question, list)
255255
suffix = ", ".join(question)
256256
suffix = f"{prev2_offset} seconds ago, you started an action {prev2_narration}. {prev1_offset} seconds ago, you started an action {prev1_narration}. What action are you currently performing? Here are the options of actions you can select:\n" + suffix
257-
ret = prefix + suffix
257+
ret = prefix + suffix
258+
rank0_print('debug')
259+
rank0_print (meta_data)
260+
rank0_print (ret)
261+
258262
else:
259263
action_rep_suffix = "Given multiple choices, format your answer briefly such as 'A. move knife'. "
260264
prefix = f"{perspective_prefix}{action_rep_suffix}\n"

0 commit comments

Comments
 (0)