Skip to content

Commit

Permalink
fix json sheet bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rayguan97 committed Nov 13, 2023
1 parent 98a46a8 commit e286d13
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion HallusionBench.json

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions tsv_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def get_image_file_location(root, row):
'question':7,
'gt_answer_details':8,
'gt_answer':9,
'gpt4v_output':10,
'gpt4v_output_human_check': 11,
# 'gpt4v_output':10,
# 'gpt4v_output_human_check': 11,
# 'llava_1_5_output':12,
# 'llava_1_5_output_human_check': 13,
}
Expand All @@ -36,11 +36,14 @@ def get_image_file_location(root, row):
if line[0] not in ["VD", "VS"]:
continue
data_dict = {}
for k, v in col_idx.items():
data_dict[k] = line[v]
assert int(line[col_idx["gt_answer"]]) == 0 or int(line[col_idx["gt_answer"]]) == 1 or int(line[col_idx["gt_answer"]]) == 2
assert int(line[col_idx["gpt4v_output_human_check"]]) == 0 or int(line[col_idx["gpt4v_output_human_check"]]) == 1 or int(line[col_idx["gpt4v_output_human_check"]]) == 2

try:
for k, v in col_idx.items():
data_dict[k] = line[v]
assert int(line[col_idx["gt_answer"]]) == 0 or int(line[col_idx["gt_answer"]]) == 1 or int(line[col_idx["gt_answer"]]) == 2
# assert int(line[col_idx["gpt4v_output_human_check"]]) == 0 or int(line[col_idx["gpt4v_output_human_check"]]) == 1 or int(line[col_idx["gpt4v_output_human_check"]]) == 2
# assert int(line[col_idx["llava_1_5_output_human_check"]]) == 0 or int(line[col_idx["llava_1_5_output_human_check"]]) == 1 or int(line[col_idx["llava_1_5_output_human_check"]]) == 2
except:
from IPython import embed;embed()

data_dict["filename"] = get_image_file_location(root_dir, data_dict)
if line[0] == "VD":
Expand Down

0 comments on commit e286d13

Please sign in to comment.