-
Notifications
You must be signed in to change notification settings - Fork 615
[MVEB] Added SomethingSomething zeroshot #4542
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
Draft
x-tabdeveloping
wants to merge
6
commits into
main
Choose a base branch
from
somethingsomething
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
40bf928
Added SomethingSomething zeroshot
x-tabdeveloping a45b3ec
Added subsampling to SomethingSomethingZeroShot
x-tabdeveloping 203e557
Fixed subsampling
x-tabdeveloping ecb3169
Update mteb/tasks/zeroshot_classification/eng/something_something_v2_…
x-tabdeveloping d6ebe29
Update mteb/tasks/zeroshot_classification/eng/something_something_v2_…
x-tabdeveloping 72f9fa0
Update mteb/tasks/zeroshot_classification/eng/something_something_v2_…
x-tabdeveloping 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 hidden or 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
63 changes: 63 additions & 0 deletions
63
mteb/tasks/zeroshot_classification/eng/something_something_v2_classification.py
This file contains hidden or 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,63 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from mteb.abstasks.task_metadata import TaskMetadata | ||
| from mteb.abstasks.zeroshot_classification import AbsTaskZeroShotClassification | ||
|
|
||
|
|
||
| class SomethingSomethingV2ZeroShotClassification(AbsTaskZeroShotClassification): | ||
| metadata = TaskMetadata( | ||
| name="SomethingSomethingV2ZeroShotClassification", | ||
| description="Something-Something V2 contains 220,847 short video clips of humans performing pre-defined basic actions with everyday objects. This subset of 5,444 clips is used for action classification into 174 fine-grained categories.", | ||
| reference="https://developer.qualcomm.com/software/ai-datasets/something-something", | ||
| dataset={ | ||
| "path": "mteb/SomethingSomethingV2", | ||
| "revision": "13bbc49a06df3ffe41f3823cf429e2d8d685689f", | ||
| }, | ||
| type="VideoZeroshotClassification", | ||
| category="v2t", | ||
| eval_splits=["test"], | ||
| eval_langs=["eng-Latn"], | ||
| main_score="accuracy", | ||
| date=( | ||
| "2017-06-01", | ||
| "2017-12-31", | ||
| ), | ||
| domains=["Scene"], | ||
| task_subtypes=["Activity recognition"], | ||
| license="not specified", | ||
| annotations_creators="human-annotated", | ||
| dialect=[], | ||
| modalities=["video", "text"], | ||
| sample_creation="found", | ||
| is_beta=True, | ||
| bibtex_citation=r""" | ||
| @inproceedings{goyal2017something, | ||
| author = {Goyal, Raghav and Ebrahimi Kahou, Samira and Michalski, Vincent and Materzy{\'n}ska, Joanna and Westphal, Susanne and Kim, Heuna and Haenel, Valentin and Fruend, Ingo and Yianilos, Peter and Mueller-Freitag, Moritz and Hoppe, Florian and Thurau, Christian and Bax, Ingo and Memisevic, Roland}, | ||
| booktitle = {2017 IEEE International Conference on Computer Vision (ICCV)}, | ||
| doi = {10.1109/ICCV.2017.622}, | ||
| pages = {5843-5851}, | ||
| title = {The "Something Something" Video Database for Learning and Evaluating Visual Common Sense}, | ||
| year = {2017}, | ||
| } | ||
| """, | ||
| ) | ||
|
|
||
| input_column_name = "video" | ||
| label_column_name: str = "label" | ||
|
|
||
| is_cross_validation: bool = True | ||
|
|
||
| def get_candidate_labels(self) -> list[str]: | ||
| return [ | ||
| f"a video of {name}" | ||
| for name in self.dataset["test"].features[self.label_column_name].names | ||
| ] | ||
|
|
||
| def dataset_transform(self, num_proc=None): | ||
| self.dataset = self.stratified_subsampling( | ||
| self.dataset, | ||
| seed=self.seed, | ||
| splits=["test"], | ||
| label=self.label_column_name, | ||
| n_samples=2048, | ||
| ) | ||
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.
if you push this using this command:
https://embeddings-benchmark.github.io/mteb/contributing/adding_a_dataset/#pushing-the-dataset-to-the-hub
then we avoid downloading the whole thing during eval