-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MixEval-X Image / Video #434
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1fad5d9
reformat mix eval
pufanyi 715df25
video2text fix
pufanyi cc232f7
video
pufanyi b89847a
Add image-to-text evaluation tasks and templates
pufanyi 5e23413
Refactor image-to-text evaluation tasks and update configurations
pufanyi 4fddfff
Enhance LlamaVision model with video loading improvements and configu…
pufanyi b4ccbe1
fix internvl2
pufanyi aa5c5bf
llava vid default numframe too small
pufanyi 11540d1
add max_new_tokens
pufanyi 57f8c43
remove "with a short phrase" for `gpt4v`
pufanyi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import os | ||
import re | ||
import sys | ||
import unicodedata | ||
|
||
import openai | ||
|
||
from lmms_eval.api.filter import Filter | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
lmms_eval/tasks/mix_evals/audio2text/mix_evals_audio2text.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
group: mix_evals_audio2text | ||
task: | ||
- mix_evals_audio2_text_freeform |
13 changes: 13 additions & 0 deletions
13
lmms_eval/tasks/mix_evals/image2text/_default_template_yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
dataset_path: MixEval/MixEval-X | ||
dataset_kwargs: | ||
video: true # a bit confusing, but this is because the official uses path to store image data, so we need to load it as a video dataset | ||
cache_dir: mix_evals_image2text | ||
lmms_eval_specific_kwargs: | ||
default: | ||
post_prompt: "" | ||
pre_prompt: "" | ||
gpt4v: | ||
post_prompt: "" | ||
pre_prompt: "" | ||
metadata: | ||
version: 0 |
4 changes: 4 additions & 0 deletions
4
lmms_eval/tasks/mix_evals/image2text/mix_evals_image2text.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
group: mix_evals_image2text | ||
task: | ||
- mix_evals_image2text_mc | ||
- mix_evals_image2text_freeform |
17 changes: 17 additions & 0 deletions
17
lmms_eval/tasks/mix_evals/image2text/mix_evals_image2text_freeform.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
task: "mix_evals_image2text_freeform" | ||
dataset_name: "image2text" | ||
test_split: free_form | ||
output_type: generate_until | ||
doc_to_visual: !function utils.mix_evals_image2text_doc_to_visual | ||
doc_to_text: !function utils.mix_evals_image2text_doc_to_text | ||
doc_to_target: "{{reference_answer}}" | ||
process_results: !function utils.mix_evals_image2text_process_results_freeform | ||
metric_list: | ||
- metric: gpt_eval | ||
aggregation: !function utils.mix_evals_image2text_gpt_eval | ||
higher_is_better: true | ||
|
||
generation_kwargs: | ||
max_new_tokens: 1024 | ||
|
||
include: _default_template_yaml |
25 changes: 25 additions & 0 deletions
25
lmms_eval/tasks/mix_evals/image2text/mix_evals_image2text_freeform_hard.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
task: "mix_evals_image2text_freeform_hard" | ||
dataset_name: "image2text" | ||
test_split: free_form_hard | ||
output_type: generate_until | ||
doc_to_visual: !function utils.mix_evals_image2text_doc_to_visual | ||
doc_to_text: !function utils.mix_evals_image2text_doc_to_text | ||
doc_to_target: "{{reference_answer}}" | ||
process_results: !function utils.mix_evals_image2text_process_results_freeform | ||
metric_list: | ||
- metric: gpt_eval | ||
aggregation: !function utils.mix_evals_image2text_gpt_eval | ||
higher_is_better: true | ||
|
||
generation_kwargs: | ||
max_new_tokens: 1024 | ||
|
||
include: _default_template_yaml | ||
|
||
lmms_eval_specific_kwargs: | ||
default: | ||
pre_prompt: "Please answer the following questions about the image." | ||
post_prompt: "" | ||
gpt4v: | ||
pre_prompt: "Please answer the following questions about the image." | ||
post_prompt: "" |
5 changes: 5 additions & 0 deletions
5
lmms_eval/tasks/mix_evals/image2text/mix_evals_image2text_hard.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
group: mix_evals_image2text_hard | ||
task: | ||
- mix_evals_image2text_mc_hard | ||
- mix_evals_image2text_freeform_hard | ||
# - mix_evals_image2text_openended |
23 changes: 23 additions & 0 deletions
23
lmms_eval/tasks/mix_evals/image2text/mix_evals_image2text_mc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
include: _default_template_yaml | ||
task: "mix_evals_image2text_mc" | ||
dataset_name: "image2text" | ||
test_split: multiple_choice | ||
output_type: generate_until | ||
doc_to_visual: !function utils.mix_evals_image2text_doc_to_visual | ||
doc_to_text: !function utils.mix_evals_image2text_doc_to_text | ||
doc_to_target: "{{reference_answer}}" | ||
|
||
generation_kwargs: | ||
max_new_tokens: 1024 | ||
|
||
metric_list: | ||
- metric: exact_match | ||
aggregation: mean | ||
higher_is_better: true | ||
ignore_case: true | ||
ignore_punctuation: true | ||
|
||
filter_list: | ||
- name: "flexible-extract" | ||
filter: | ||
- function: !function utils.GPTMultiChoiceFilter |
23 changes: 23 additions & 0 deletions
23
lmms_eval/tasks/mix_evals/image2text/mix_evals_image2text_mc_hard.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
include: _default_template_yaml | ||
task: "mix_evals_image2text_mc_hard" | ||
dataset_name: "image2text" | ||
test_split: multiple_choice_hard | ||
output_type: generate_until | ||
doc_to_visual: !function utils.mix_evals_image2text_doc_to_visual | ||
doc_to_text: !function utils.mix_evals_image2text_doc_to_text | ||
doc_to_target: "{{reference_answer}}" | ||
|
||
generation_kwargs: | ||
max_new_tokens: 1024 | ||
|
||
metric_list: | ||
- metric: exact_match | ||
aggregation: mean | ||
higher_is_better: true | ||
ignore_case: true | ||
ignore_punctuation: true | ||
|
||
filter_list: | ||
- name: "flexible-extract" | ||
filter: | ||
- function: !function utils.GPTMultiChoiceFilter |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This currently breaks as
read_video_pyav_pil
doesn't exist @pufanyiThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pufanyi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, sorry about this. It seems that this change was accidentally brought over from another branch. Thank you for pointing it out! I've reverted it in #447.