DaYin commited on
Commit
ce50391
1 Parent(s): 316e24d

Update data_utils.py

Browse files
Files changed (1) hide show
  1. data_utils.py +7 -0
data_utils.py CHANGED
@@ -120,6 +120,7 @@ def sample_an_eval_result(eval_results, model_list=[]):
120
  random.shuffle(eval_results)
121
 
122
  for eval_item in eval_results:
 
123
  model = eval_item['model']
124
  task_type = eval_item['task_type'] # primary task type
125
  if model not in model_list:
@@ -135,6 +136,9 @@ def sample_an_eval_result(eval_results, model_list=[]):
135
  "task_type": task_type,
136
  "plan_history": plan_history,
137
  "ground_history": ground_history,
 
 
 
138
  "image": eval_item['image'].replace("eval/aokvqa/images/val2017/", "file/data_dir/test_images/")
139
  }
140
  else:
@@ -144,6 +148,9 @@ def sample_an_eval_result(eval_results, model_list=[]):
144
  "task_type": task_type,
145
  "plan_history": plan_history,
146
  "ground_history": ground_history,
 
 
 
147
  "image": None
148
  }
149
  break
 
120
  random.shuffle(eval_results)
121
 
122
  for eval_item in eval_results:
123
+ print(eval_item.keys())
124
  model = eval_item['model']
125
  task_type = eval_item['task_type'] # primary task type
126
  if model not in model_list:
 
136
  "task_type": task_type,
137
  "plan_history": plan_history,
138
  "ground_history": ground_history,
139
+ "pred": eval_item['pred'],
140
+ "answer": eval_item['answer'],
141
+ "correctness": eval_item['correctness'],
142
  "image": eval_item['image'].replace("eval/aokvqa/images/val2017/", "file/data_dir/test_images/")
143
  }
144
  else:
 
148
  "task_type": task_type,
149
  "plan_history": plan_history,
150
  "ground_history": ground_history,
151
+ "pred": eval_item['pred'],
152
+ "answer": eval_item['answer'],
153
+ "correctness": eval_item['correctness'],
154
  "image": None
155
  }
156
  break