Skip to content
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

[MIEB] Add image clustering #1088

Merged
merged 8 commits into from
Jul 15, 2024
Merged

[MIEB] Add image clustering #1088

merged 8 commits into from
Jul 15, 2024

Conversation

isaac-chung
Copy link
Collaborator

@isaac-chung isaac-chung commented Jul 15, 2024

Checklist

  • Run tests locally to make sure nothing is broken using make test.
  • Run the formatter to format the code using make lint.

Adding datasets checklist

Reason for dataset addition: ...

  • I have run the following models on the task (adding the results to the pr). These can be run using the mteb -m {model_name} -t {task_name} command.
    • sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
    • intfloat/multilingual-e5-small
  • I have checked that the performance is neither trivial (both models gain close to perfect scores) nor random (both models gain close to random scores).
  • If the dataset is too big (e.g. >2048 examples), considering using self.stratified_subsampling() under dataset_transform()
  • I have filled out the metadata object in the dataset file (find documentation on it here).
  • Run tests locally to make sure nothing is broken using make test.
  • Run the formatter to format the code using make lint.

@gowitheflow-1998
Copy link
Contributor

looks amazing! Thanks for adding these. It seems like image clustering typically uses NMI, ARI and accuracy as metrics such as benchmark benchmark paper paper paper. Will be good to add support for these. Otherwise all good!

@isaac-chung
Copy link
Collaborator Author

@gowitheflow-1998 I think there's an error when we run make test from tests/test_all_abstasks.py::test_load_data on the MSCOCOI2TRetrieval task. Could you please take a look when you have a chance?

@isaac-chung isaac-chung marked this pull request as ready for review July 15, 2024 17:04
@gowitheflow-1998
Copy link
Contributor

@gowitheflow-1998 I think there's an error when we run make test from tests/test_all_abstasks.py::test_load_data on the MSCOCOI2TRetrieval task. Could you please take a look when you have a chance?

@isaac-chung The problem was load_dataset detected not called by AbsTaskI2TRetrieval, which should also be ignored following previous tests in main. I'll add or isinstance(task, AbsTaskI2TRetrieval) in test_all_abstasks.py if you could pull and push again after adding metrics?

def test_load_data(
    mock_concatenate_datasets: Mock, mock_load_dataset: Mock, task: AbsTask
):
    # TODO: We skip because this load_data is completely different.
    if (
        isinstance(task, AbsTaskRetrieval)
        or isinstance(task, AbsTaskI2TRetrieval)
        or isinstance(task, AbsTaskInstructionRetrieval)
        or isinstance(task, MultiSubsetLoader)
        or isinstance(task, AbsTaskSpeedTask)
    ):
        pytest.skip()

@isaac-chung
Copy link
Collaborator Author

@gowitheflow-1998 thanks! Tests are passing now.

I've added accuracy for Tiny ImageNet. I think any additional metrics can be added along with the datasets that use them? I feel that this can be merged now and we can iterate.

@isaac-chung isaac-chung merged commit ddc4b6e into mieb Jul 15, 2024
7 checks passed
@isaac-chung isaac-chung deleted the add-image-clustering branch July 15, 2024 19:03
isaac-chung added a commit that referenced this pull request Aug 14, 2024
* mieb ZeroshotClassification
* mieb docs
* mieb implementation demo
* model meta; abstask column names; linear probe clf
* model meta; abstask column names; linear probe clf
* fix: update naming as candidate_labels
* Update README.md
* Update README.md
* i2tretrieval
* test load data ignore i2tretrieval
* [MIEB] Add image clustering (#1088)
* make lint
* wip
* add TinyImageNet and run
* type hints
* add accuracy
* lint
* remove unused & fix typos
* T2I Retrieval
* Any2AnyRetrieval
* fix tests from merge
* [MIEB] Add image text pair classification and tests (#1099)
* add ImageTextPairClassification abstask and evaluator
* dataset transform into sequence of images for each sample
* fix processing logic; list of list images compatability
* lint and docstrings
* make lint
* fix failing tests in TaskMetadata
* add tests for mieb
* skip gated repo
---------
Co-authored-by: gowitheflow-1998 <[email protected]>
* [MIEB] Add image classification and zero shot classification tasks (#1101)
* fix task metadata
* use overrideable column names
* add CIFAR datasets
* add caltech101 dataset
* add FGVC aircraft dataset
* add food 101 dataset
* add OxfordPets dataset
* remove comments
* correct cifar100 path
* update cifar100 classification results
* cifar zero shot results
* add caltech101 zero shot
* matching CLIP paper implementation
* add aircraft and food zero shot
* add oxford pets zero shot
* [MIEB] Add CIFAR clustering (#1104)
add CIFAR clustering
* [MIEB] Add more image classification and zero shot classification datasets (#1103)
* update category to i2t
* add MNIST linear probe and zero shot
* add FER2013 linear probe and zero shot
* add stanford cars linear probe and zero shot
* add birdsnap linear probe and zero shot
* add eurosat linear probe and zero shot
* lint
* correct eurosat zero shot labels
* add abstask for image multilable and voc2007
* make lint
* [MIEB] Add more image classification and zero shot datasets (#1105)
* add STL10 linear probe and zero shot
* add RESISC45 linear probe and zeor shot
* add Describable textures linear probe and zero shot
* fix spacing lint
* add SUN397 linear probe and zero shot
* correct SUN397 zero shot captions
* add baai bge vista
* add e5-v
* linting
* memory issues for image linear probe & zeroshot
* kknn linear probe arguments
* del comments
* Add some classification and ZeroShot classification tasks (#1107)
* Add Country211 classification task
* Add imagenet1k classification task
* Add UCF101 classification task
* Add PatchCamelyon Classification task
* Add GTSRB classification task
* Add GSTRB Zero Shot Classification
* Add country211 zero shot classification
* Add results for classification tasks
* Add zero shot classification tasks
* Add PatchCamelyon tasks and results
* Add linting
* Add results and fix prompts for zero shot
* Add results
* Add results and linting
* fix dependency & clip mock test
* [MIEB] Add jina clip (#1120)
* add jina clip and mscoco i2t and t2i results
* make lint
* [MIEB] Update `mieb` with the `main` branch and some fixes (#1126)
* fix instruction retrival (#1072)
* fix instruction retrival
* fix test
* add points
* make nested results
* add test
* skip instruction test
* fix instruction passes
* fix unions
* move do_length_ablation
Co-authored-by: Kenneth Enevoldsen <[email protected]>
---------
Co-authored-by: Kenneth Enevoldsen <[email protected]>
* Update points table
* fix: fix bug-causing spelling error in function name of e5-mistral-instruct (#1106)
found bug
* 1.12.85
Automatically generated by python-semantic-release
* fix: MultilingualSentimentClassification (#1109)
* Update points table
* fix: Avoid spaces in dataset name for CQADupstack and ignore speed tasks
* 1.12.86
Automatically generated by python-semantic-release
* fix: Ensure that MLSUMClusteringP2P.v2 use the fast implementation as was intended (#1112)
* fix: Ensure that MLSUMClusteringP2P.v2 use the fast implementation as was intended
* fix: fixed formatting for cli
* docs: improve searchability in the advanced usage documentation
* 1.12.87
Automatically generated by python-semantic-release
* docs: improve searchability in the advanced usage documentation (#1113)
* docs: improve searchability in the advanced usage documentation
* docs: update based on corrections
* fix: export type for `mteb create_meta` (#1114)
* fix export type
* fix dataset version too
* 1.12.88
Automatically generated by python-semantic-release
* fix: Simplify models implementations (#1085)
* Merge
* Adapt
* Simplify
* Check for rev again
* Rmv cmmnt
* Simplify
* simplify
* Rmv comment
Co-authored-by: Kenneth Enevoldsen <[email protected]>
* Use logging; change try except; add info
* Lint
* Rmv results
* Update rev
* format
* Simplify models; Allow instructions
* Jobs
* Fix merge
* Format
* Adapt models
* fix: ensure that e5 ignores the NQ
* format
---------
Co-authored-by: Kenneth Enevoldsen <[email protected]>
* 1.12.89
Automatically generated by python-semantic-release
* fix: nomic models using prefix correctly (#1125)
* fix: nomic models using prefix correctly
* chore: remove comment
* fix: handling in case not torch tensor
* Fix typo
---------
Co-authored-by: Niklas Muennighoff <[email protected]>
* 1.12.90
Automatically generated by python-semantic-release
* refactor vista model wrapper to contain lib import
* python 38 type hints
---------
Co-authored-by: Roman Solomatin <[email protected]>
Co-authored-by: Kenneth Enevoldsen <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: anpalmak2003 <[email protected]>
Co-authored-by: github-actions <[email protected]>
Co-authored-by: Niklas Muennighoff <[email protected]>
Co-authored-by: Zach Nussbaum <[email protected]>
Co-authored-by: chenghao xiao <[email protected]>
* image memoery issues for all retrieval Abstasks
* Add CLEVR and SciMMIR Image-Text Understanding tasks (#1127)
* Add CLEVER and SciMMIR
* Update metadata
* remove useless comment
* Add linting
* fix typo and tests
* Add CLEVR count task
* add linting
* add fashion200k & fashionIQ test passed
* clip text max seq truncation
* add WebQA, NIGHTS, OVEN
* any2any retrieval chunk encoding
* add nomic vision model; any2any topk bug
* add cv recall
* add InfoSeek; VisualNews
* [MIEB] Add Stanford Cars i2i Retrieval (#1147)
* wip
* add results
* make lint
* change back the order
* [MIEB] Add CUB200 i2i retrieval (#1154)
* add cub200 and results
* add skip_first_result
* skipped self and rerun results
* consolidate i2t and t2i to any2any
* remove abstask and evaluators
* remove references from test
---------
Co-authored-by: gowitheflow-1998 <[email protected]>
Co-authored-by: chenghao xiao <[email protected]>
Co-authored-by: Imene Kerboua <[email protected]>
Co-authored-by: Roman Solomatin <[email protected]>
Co-authored-by: Kenneth Enevoldsen <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: anpalmak2003 <[email protected]>
Co-authored-by: github-actions <[email protected]>
Co-authored-by: Niklas Muennighoff <[email protected]>
Co-authored-by: Zach Nussbaum <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants