Skip to content

Commit e46eef1

Browse files
author
Haozhe Qi
committed
fixed known issues
1 parent 16f503f commit e46eef1

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

llava/action/ek_eval.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,9 @@ def collate_fn(batch):
341341
meta_data = None
342342
if eval_args.learn_neighbor_actions:
343343
from llava.action.generate_interval_pred import get_lookup_dict
344-
lookup_table = get_lookup_dict(eval_args.val_metadata, test_type = eval_args.test_type, pseudo_folder = eval_args.pseudo_folder)
344+
if eval_args.test_type.startswith('temporal_cot'):
345+
346+
lookup_table = get_lookup_dict(eval_args.val_metadata, test_type = eval_args.test_type, pseudo_folder = eval_args.pseudo_folder)
345347

346348

347349
for idx, (frames, mc_data, time_meta, global_index) in tqdm(enumerate(val_dataloader)):

llava/action/generate_interval_pred.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ def get_lookup_dict(ann_file, test_type = 'base', delta = 3, pseudo_folder = Non
131131

132132
pseudo_dict = None
133133
if test_type == 'temporal_cot':
134+
assert os.path.exists(pseudo_folder), f"Folder {pseudo_folder} does not exist"
134135
pseudo_dict = get_pseudo_dict(pseudo_folder)
135136

136137
for vid, intervals in vid_to_intervals.items():

llava/action/llava_inference.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def llava_inference(
5555
question_type = "caption"
5656
elif test_type == 'temporal_cot':
5757
question_type = 'temporal_cot'
58+
elif test_type == 'temporal_cot_oracle':
59+
question_type = 'temporal_cot_oracle'
5860

5961
if test_type == 'caption_then_answer':
6062
caption_answer = llava_inference([video_frames],

llava/action/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def format_task_related_prompt(question, question_type, meta_data = None, perspe
253253
prefix = f"{perspective_prefix}\n"
254254
assert isinstance(question, list)
255255
suffix = ", ".join(question)
256-
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? Explain your thoughts and then answer the question. Here are the options of actions you can select:\n" + suffix
256+
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
257257
ret = prefix + suffix
258258
else:
259259
action_rep_suffix = "Given multiple choices, format your answer briefly such as 'A. move knife'. "

0 commit comments

Comments
 (0)