kaiko-eva


Namekaiko-eva JSON
Version 0.1.8 PyPI version JSON
download
home_pageNone
SummaryEvaluation Framework for oncology foundation models.
upload_time2024-12-20 11:19:55
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseApache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2024 kaiko.ai Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords machine-learning evaluation-framework oncology foundation-models
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">

<br />

<img src="https://github.com/kaiko-ai/eva/blob/main/docs/images/eva-logo.png?raw=true" width="340">

<br />
<br />

_Oncology FM Evaluation Framework by kaiko.ai_

[![PyPI](https://img.shields.io/pypi/v/kaiko-eva.svg?logo=python)](https://pypi.python.org/pypi/kaiko-eva)
[![docs](https://img.shields.io/badge/📚_docs-latest-green)](https://kaiko-ai.github.io/eva/latest)
[![license](https://img.shields.io/badge/⚖️_License-Apache%202.0-blue.svg?labelColor=gray)](https://github.com/kaiko-ai/eva#license)<br>
[![paper](http://img.shields.io/badge/OpenReview-MIDL_2024-B31B1B.svg)](https://openreview.net/forum?id=FNBQOPj18N&noteId=FNBQOPj18N)

<p align="center">
  <a href="https://github.com/kaiko-ai/eva#installation">Installation</a> •
  <a href="https://github.com/kaiko-ai/eva#how-to-use">How To Use</a> •
  <a href="https://github.com/kaiko-ai/eva#quick-start">Quick Start</a> •
  <a href="https://kaiko-ai.github.io/eva/">Documentation</a> •
  <a href="https://kaiko-ai.github.io/eva/dev/datasets/">Datasets</a> •
  <a href="https://github.com/kaiko-ai/eva#benchmarks">Benchmarks</a> <br>
  <a href="https://github.com/kaiko-ai/eva#contributing">Contribute</a> •
  <a href="https://github.com/kaiko-ai/eva#acknowledgements">Acknowledgements</a>
</p>

</div>

<br />

_`eva`_ is an evaluation framework for oncology foundation models (FMs) by [kaiko.ai](https://kaiko.ai/).
Check out the [documentation](https://kaiko-ai.github.io/eva/) for more information.

### Highlights:
- Easy and reliable benchmark of Oncology FMs
- Supports path-level classification, slide-level classification and semantic segmentation downstream tasks
- Automatic embedding inference and evaluation of a downstream task
- Native support of popular medical [datasets](https://kaiko-ai.github.io/eva/dev/datasets/) and models
- Produce statistics over multiple evaluation fits and multiple metrics

## Installation

Simple installation from PyPI:
```sh
# to install the core version only
pip install kaiko-eva

# to install the expanded `vision` version
pip install 'kaiko-eva[vision]'

# to install everything
pip install 'kaiko-eva[all]'
```

To install the latest version of the `main` branch:
```sh
pip install "kaiko-eva[all] @ git+https://github.com/kaiko-ai/eva.git"
```

You can verify that the installation was successful by executing:
```sh
eva --version
```

## How To Use

_`eva`_ can be used directly from the terminal as a CLI tool as follows:
```sh
eva {fit,predict,predict_fit} --config url/or/path/to/the/config.yaml 
```

_`eva`_ uses [jsonargparse](https://jsonargparse.readthedocs.io/en/v4.31.0/) to
make it easily configurable by automatically generating command line interfaces (CLIs),
which allows to call *any* Python object from the command line. Moreover, the configuration structure is always in sync with the code. Thus, _`eva`_ can be used either directly from Python or as a CLI tool (recommended).

For more information, please refer to the [documentation](https://kaiko-ai.github.io/eva/dev/user-guide/tutorials/offline_vs_online/).

<details>
  <summary>Learn about Configs</summary>

The following interfaces are identical:
<table>
<tr>
<th>Python interface</th>
<th>Configuration file</th>
</tr>
<tr>
<td>
<sub>

```Python
# main.py
# execute with: `python main.py`

from torch import nn

from eva import core
from eva.vision import datasets, transforms

# initialize trainer
trainer = core.Trainer(max_steps=100)

# initialize model
model = core.HeadModule(
  backbone=nn.Flatten(),
  head=nn.Linear(150528, 4),
  criterion=nn.CrossEntropyLoss(),
)

# initialize data
data = core.DataModule(
  datasets=core.DatasetsSchema(
    train=datasets.BACH(
      root="data/bach",
      split="train",
      download=True,
      transforms=transforms.ResizeAndCrop(),
    ),
  ),
  dataloaders=core.DataloadersSchema(
    train=core.DataLoader(batch_size=32),
  ),
)

# perform fit
pipeline = core.Interface()
pipeline.fit(trainer, model=model, data=data)
```
</sub>
<td>
<sub>

```yaml
# main.yaml
# execute with: `eva fit --config main.yaml`

---
trainer:
  class_path: eva.Trainer
  init_args:
    max_steps: 100
model:
  class_path: eva.HeadModule
  init_args:
    backbone: torch.nn.Flatten
    head:
      class_path: torch.nn.Linear
      init_args:
        in_features: 150528
        out_features: 4
    criterion: torch.nn.CrossEntropyLoss
data:
  class_path: eva.DataModule
  init_args:
    datasets:
      train:
        class_path: eva.vision.datasets.BACH
        init_args:
          root: ./data/bach
          split: train
          download: true
          transforms: eva.vision.transforms.ResizeAndCrop
    dataloaders:
      train:
        batch_size: 32
```
</sub>
</td>
</tr>
</table>

The `.yaml` file defines the functionality of _`eva`_
by parsing and translating its content to Python objects directly.
Native supported configs can be found at the
[configs](https://github.com/kaiko-ai/eva/tree/main/configs) directory
of the repo, which can be both locally stored or remote.

</details>

## Quick Start

We define two types of evaluations: **online** and **offline**.
While online fit uses the backbone (FM) to perform forward passes
during the fitting process, offline fit first generates embeddings
with the backbone and then fits the model using these embeddings as
input, resulting in a faster evaluation.

Here are some examples to get you started:

- Perform a downstream offline **classification** evaluation of `DINO ViT-S/16`
on the `BACH` dataset with linear probing by first inferring the embeddings
and then performing 5 sequential fits:
  ```sh
  export DOWNLOAD_DATA=true
  eva predict_fit --config https://raw.githubusercontent.com/kaiko-ai/eva/main/configs/vision/dino_vit/offline/bach.yaml
  ```

- Perform a downstream online **segmentation** evaluation of `DINO ViT-S/16` on the
`MoNuSAC` dataset with the `ConvDecoderMS` decoder:
  ```sh
  export DOWNLOAD_DATA=true
  eva fit --config https://raw.githubusercontent.com/kaiko-ai/eva/main/configs/vision/dino_vit/online/monusac.yaml
  ```

For more examples, take a look at the [configs](https://github.com/kaiko-ai/eva/tree/main/configs)
and [tutorials](https://kaiko-ai.github.io/eva/dev/user-guide/advanced/replicate_evaluations/).

> [!NOTE]
> All the datasets that support automatic download in the repo have by default the option to automatically download set to false.
> For automatic download you have to manually set the environmental variable `DOWNLOAD_DATA=true` or in the configuration file `download=true`.

## Leaderboards

The following table shows the FMs we have evaluated with _`eva`_. For more detailed information about the evaluation process, please refer to our [documentation](https://kaiko-ai.github.io/eva/main/leaderboards/).

![Pathology Leaderboard](./docs/images/leaderboard.svg)


## Contributing

_`eva`_ is an open source project and welcomes contributions of all kinds. Please checkout the [developer](./docs/DEVELOPER_GUIDE.md)
and [contributing guide](./docs/CONTRIBUTING.md) for help on how to do so.

All contributors must follow the [code of conduct](./docs/CODE_OF_CONDUCT.md).


## Acknowledgements

Our codebase is built using multiple opensource contributions

<div align="center">

[![python](https://img.shields.io/badge/-Python-blue?logo=python&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![pytorch](https://img.shields.io/badge/PyTorch-ee4c2c?logo=pytorch&logoColor=white)](https://pytorch.org/get-started/locally/)
[![lightning](https://img.shields.io/badge/-⚡️_Lightning-792ee5?logo=pytorchlightning&logoColor=white)](https://pytorchlightning.ai/)<br>
[![black](https://img.shields.io/badge/Code%20Style-Black-black.svg?labelColor=gray)](https://black.readthedocs.io/en/stable/)
[![isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)<br>
[![pdm-managed](https://img.shields.io/badge/pdm-managed-blueviolet)](https://pdm-project.org)
[![Nox](https://img.shields.io/badge/%F0%9F%A6%8A-Nox-D85E00.svg)](https://github.com/wntrblm/nox)
[![Built with Material for MkDocs](https://img.shields.io/badge/Material_for_MkDocs-526CFE?logo=MaterialForMkDocs&logoColor=white)](https://squidfunk.github.io/mkdocs-material/)

</div>


## Citation

If you find this repository useful, please consider giving a star ⭐ and adding the following citation:

```bibtex
@inproceedings{kaiko.ai2024eva,
    title={eva: Evaluation framework for pathology foundation models},
    author={kaiko.ai and Ioannis Gatopoulos and Nicolas K{\"a}nzig and Roman Moser and Sebastian Ot{\'a}lora},
    booktitle={Medical Imaging with Deep Learning},
    year={2024},
    url={https://openreview.net/forum?id=FNBQOPj18N}
}
```

<br />

<div align="center">
  <img src="https://github.com/kaiko-ai/eva/blob/main/docs/images/kaiko-logo.png?raw=true" width="200">
</div>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "kaiko-eva",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "Ioannis Gatopoulos <ioannis@kaiko.ai>, Nicolas K\u00e4nzig <nicolas@kaiko.ai>, Roman Moser <roman@kaiko.ai>",
    "keywords": "machine-learning, evaluation-framework, oncology, foundation-models",
    "author": null,
    "author_email": "Ioannis Gatopoulos <ioannis@kaiko.ai>, Nicolas K\u00e4nzig <nicolas@kaiko.ai>, Roman Moser <roman@kaiko.ai>",
    "download_url": "https://files.pythonhosted.org/packages/66/94/507067dbfbd4e95327cfadd76b0dfc5f8e3d86b1a0d3fda7168d79ed5de1/kaiko_eva-0.1.8.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n<br />\n\n<img src=\"https://github.com/kaiko-ai/eva/blob/main/docs/images/eva-logo.png?raw=true\" width=\"340\">\n\n<br />\n<br />\n\n_Oncology FM Evaluation Framework by kaiko.ai_\n\n[![PyPI](https://img.shields.io/pypi/v/kaiko-eva.svg?logo=python)](https://pypi.python.org/pypi/kaiko-eva)\n[![docs](https://img.shields.io/badge/\ud83d\udcda_docs-latest-green)](https://kaiko-ai.github.io/eva/latest)\n[![license](https://img.shields.io/badge/\u2696\ufe0f_License-Apache%202.0-blue.svg?labelColor=gray)](https://github.com/kaiko-ai/eva#license)<br>\n[![paper](http://img.shields.io/badge/OpenReview-MIDL_2024-B31B1B.svg)](https://openreview.net/forum?id=FNBQOPj18N&noteId=FNBQOPj18N)\n\n<p align=\"center\">\n  <a href=\"https://github.com/kaiko-ai/eva#installation\">Installation</a> \u2022\n  <a href=\"https://github.com/kaiko-ai/eva#how-to-use\">How To Use</a> \u2022\n  <a href=\"https://github.com/kaiko-ai/eva#quick-start\">Quick Start</a> \u2022\n  <a href=\"https://kaiko-ai.github.io/eva/\">Documentation</a> \u2022\n  <a href=\"https://kaiko-ai.github.io/eva/dev/datasets/\">Datasets</a> \u2022\n  <a href=\"https://github.com/kaiko-ai/eva#benchmarks\">Benchmarks</a> <br>\n  <a href=\"https://github.com/kaiko-ai/eva#contributing\">Contribute</a> \u2022\n  <a href=\"https://github.com/kaiko-ai/eva#acknowledgements\">Acknowledgements</a>\n</p>\n\n</div>\n\n<br />\n\n_`eva`_ is an evaluation framework for oncology foundation models (FMs) by [kaiko.ai](https://kaiko.ai/).\nCheck out the [documentation](https://kaiko-ai.github.io/eva/) for more information.\n\n### Highlights:\n- Easy and reliable benchmark of Oncology FMs\n- Supports path-level classification, slide-level classification and semantic segmentation downstream tasks\n- Automatic embedding inference and evaluation of a downstream task\n- Native support of popular medical [datasets](https://kaiko-ai.github.io/eva/dev/datasets/) and models\n- Produce statistics over multiple evaluation fits and multiple metrics\n\n## Installation\n\nSimple installation from PyPI:\n```sh\n# to install the core version only\npip install kaiko-eva\n\n# to install the expanded `vision` version\npip install 'kaiko-eva[vision]'\n\n# to install everything\npip install 'kaiko-eva[all]'\n```\n\nTo install the latest version of the `main` branch:\n```sh\npip install \"kaiko-eva[all] @ git+https://github.com/kaiko-ai/eva.git\"\n```\n\nYou can verify that the installation was successful by executing:\n```sh\neva --version\n```\n\n## How To Use\n\n_`eva`_ can be used directly from the terminal as a CLI tool as follows:\n```sh\neva {fit,predict,predict_fit} --config url/or/path/to/the/config.yaml \n```\n\n_`eva`_ uses [jsonargparse](https://jsonargparse.readthedocs.io/en/v4.31.0/) to\nmake it easily configurable by automatically generating command line interfaces (CLIs),\nwhich allows to call *any* Python object from the command line. Moreover, the configuration structure is always in sync with the code. Thus, _`eva`_ can be used either directly from Python or as a CLI tool (recommended).\n\nFor more information, please refer to the [documentation](https://kaiko-ai.github.io/eva/dev/user-guide/tutorials/offline_vs_online/).\n\n<details>\n  <summary>Learn about Configs</summary>\n\nThe following interfaces are identical:\n<table>\n<tr>\n<th>Python interface</th>\n<th>Configuration file</th>\n</tr>\n<tr>\n<td>\n<sub>\n\n```Python\n# main.py\n# execute with: `python main.py`\n\nfrom torch import nn\n\nfrom eva import core\nfrom eva.vision import datasets, transforms\n\n# initialize trainer\ntrainer = core.Trainer(max_steps=100)\n\n# initialize model\nmodel = core.HeadModule(\n  backbone=nn.Flatten(),\n  head=nn.Linear(150528, 4),\n  criterion=nn.CrossEntropyLoss(),\n)\n\n# initialize data\ndata = core.DataModule(\n  datasets=core.DatasetsSchema(\n    train=datasets.BACH(\n      root=\"data/bach\",\n      split=\"train\",\n      download=True,\n      transforms=transforms.ResizeAndCrop(),\n    ),\n  ),\n  dataloaders=core.DataloadersSchema(\n    train=core.DataLoader(batch_size=32),\n  ),\n)\n\n# perform fit\npipeline = core.Interface()\npipeline.fit(trainer, model=model, data=data)\n```\n</sub>\n<td>\n<sub>\n\n```yaml\n# main.yaml\n# execute with: `eva fit --config main.yaml`\n\n---\ntrainer:\n  class_path: eva.Trainer\n  init_args:\n    max_steps: 100\nmodel:\n  class_path: eva.HeadModule\n  init_args:\n    backbone: torch.nn.Flatten\n    head:\n      class_path: torch.nn.Linear\n      init_args:\n        in_features: 150528\n        out_features: 4\n    criterion: torch.nn.CrossEntropyLoss\ndata:\n  class_path: eva.DataModule\n  init_args:\n    datasets:\n      train:\n        class_path: eva.vision.datasets.BACH\n        init_args:\n          root: ./data/bach\n          split: train\n          download: true\n          transforms: eva.vision.transforms.ResizeAndCrop\n    dataloaders:\n      train:\n        batch_size: 32\n```\n</sub>\n</td>\n</tr>\n</table>\n\nThe `.yaml` file defines the functionality of _`eva`_\nby parsing and translating its content to Python objects directly.\nNative supported configs can be found at the\n[configs](https://github.com/kaiko-ai/eva/tree/main/configs) directory\nof the repo, which can be both locally stored or remote.\n\n</details>\n\n## Quick Start\n\nWe define two types of evaluations: **online** and **offline**.\nWhile online fit uses the backbone (FM) to perform forward passes\nduring the fitting process, offline fit first generates embeddings\nwith the backbone and then fits the model using these embeddings as\ninput, resulting in a faster evaluation.\n\nHere are some examples to get you started:\n\n- Perform a downstream offline **classification** evaluation of `DINO ViT-S/16`\non the `BACH` dataset with linear probing by first inferring the embeddings\nand then performing 5 sequential fits:\n  ```sh\n  export DOWNLOAD_DATA=true\n  eva predict_fit --config https://raw.githubusercontent.com/kaiko-ai/eva/main/configs/vision/dino_vit/offline/bach.yaml\n  ```\n\n- Perform a downstream online **segmentation** evaluation of `DINO ViT-S/16` on the\n`MoNuSAC` dataset with the `ConvDecoderMS` decoder:\n  ```sh\n  export DOWNLOAD_DATA=true\n  eva fit --config https://raw.githubusercontent.com/kaiko-ai/eva/main/configs/vision/dino_vit/online/monusac.yaml\n  ```\n\nFor more examples, take a look at the [configs](https://github.com/kaiko-ai/eva/tree/main/configs)\nand [tutorials](https://kaiko-ai.github.io/eva/dev/user-guide/advanced/replicate_evaluations/).\n\n> [!NOTE]\n> All the datasets that support automatic download in the repo have by default the option to automatically download set to false.\n> For automatic download you have to manually set the environmental variable `DOWNLOAD_DATA=true` or in the configuration file `download=true`.\n\n## Leaderboards\n\nThe following table shows the FMs we have evaluated with _`eva`_. For more detailed information about the evaluation process, please refer to our [documentation](https://kaiko-ai.github.io/eva/main/leaderboards/).\n\n![Pathology Leaderboard](./docs/images/leaderboard.svg)\n\n\n## Contributing\n\n_`eva`_ is an open source project and welcomes contributions of all kinds. Please checkout the [developer](./docs/DEVELOPER_GUIDE.md)\nand [contributing guide](./docs/CONTRIBUTING.md) for help on how to do so.\n\nAll contributors must follow the [code of conduct](./docs/CODE_OF_CONDUCT.md).\n\n\n## Acknowledgements\n\nOur codebase is built using multiple opensource contributions\n\n<div align=\"center\">\n\n[![python](https://img.shields.io/badge/-Python-blue?logo=python&logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![pytorch](https://img.shields.io/badge/PyTorch-ee4c2c?logo=pytorch&logoColor=white)](https://pytorch.org/get-started/locally/)\n[![lightning](https://img.shields.io/badge/-\u26a1\ufe0f_Lightning-792ee5?logo=pytorchlightning&logoColor=white)](https://pytorchlightning.ai/)<br>\n[![black](https://img.shields.io/badge/Code%20Style-Black-black.svg?labelColor=gray)](https://black.readthedocs.io/en/stable/)\n[![isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)<br>\n[![pdm-managed](https://img.shields.io/badge/pdm-managed-blueviolet)](https://pdm-project.org)\n[![Nox](https://img.shields.io/badge/%F0%9F%A6%8A-Nox-D85E00.svg)](https://github.com/wntrblm/nox)\n[![Built with Material for MkDocs](https://img.shields.io/badge/Material_for_MkDocs-526CFE?logo=MaterialForMkDocs&logoColor=white)](https://squidfunk.github.io/mkdocs-material/)\n\n</div>\n\n\n## Citation\n\nIf you find this repository useful, please consider giving a star \u2b50 and adding the following citation:\n\n```bibtex\n@inproceedings{kaiko.ai2024eva,\n    title={eva: Evaluation framework for pathology foundation models},\n    author={kaiko.ai and Ioannis Gatopoulos and Nicolas K{\\\"a}nzig and Roman Moser and Sebastian Ot{\\'a}lora},\n    booktitle={Medical Imaging with Deep Learning},\n    year={2024},\n    url={https://openreview.net/forum?id=FNBQOPj18N}\n}\n```\n\n<br />\n\n<div align=\"center\">\n  <img src=\"https://github.com/kaiko-ai/eva/blob/main/docs/images/kaiko-logo.png?raw=true\" width=\"200\">\n</div>\n",
    "bugtrack_url": null,
    "license": "Apache License                                    Version 2.0, January 2004                                 http://www.apache.org/licenses/                     TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION                     1. Definitions.                        \"License\" shall mean the terms and conditions for use, reproduction,               and distribution as defined by Sections 1 through 9 of this document.                        \"Licensor\" shall mean the copyright owner or entity authorized by               the copyright owner that is granting the License.                        \"Legal Entity\" shall mean the union of the acting entity and all               other entities that control, are controlled by, or are under common               control with that entity. For the purposes of this definition,               \"control\" means (i) the power, direct or indirect, to cause the               direction or management of such entity, whether by contract or               otherwise, or (ii) ownership of fifty percent (50%) or more of the               outstanding shares, or (iii) beneficial ownership of such entity.                        \"You\" (or \"Your\") shall mean an individual or Legal Entity               exercising permissions granted by this License.                        \"Source\" form shall mean the preferred form for making modifications,               including but not limited to software source code, documentation               source, and configuration files.                        \"Object\" form shall mean any form resulting from mechanical               transformation or translation of a Source form, including but               not limited to compiled object code, generated documentation,               and conversions to other media types.                        \"Work\" shall mean the work of authorship, whether in Source or               Object form, made available under the License, as indicated by a               copyright notice that is included in or attached to the work               (an example is provided in the Appendix below).                        \"Derivative Works\" shall mean any work, whether in Source or Object               form, that is based on (or derived from) the Work and for which the               editorial revisions, annotations, elaborations, or other modifications               represent, as a whole, an original work of authorship. For the purposes               of this License, Derivative Works shall not include works that remain               separable from, or merely link (or bind by name) to the interfaces of,               the Work and Derivative Works thereof.                        \"Contribution\" shall mean any work of authorship, including               the original version of the Work and any modifications or additions               to that Work or Derivative Works thereof, that is intentionally               submitted to Licensor for inclusion in the Work by the copyright owner               or by an individual or Legal Entity authorized to submit on behalf of               the copyright owner. For the purposes of this definition, \"submitted\"               means any form of electronic, verbal, or written communication sent               to the Licensor or its representatives, including but not limited to               communication on electronic mailing lists, source code control systems,               and issue tracking systems that are managed by, or on behalf of, the               Licensor for the purpose of discussing and improving the Work, but               excluding communication that is conspicuously marked or otherwise               designated in writing by the copyright owner as \"Not a Contribution.\"                        \"Contributor\" shall mean Licensor and any individual or Legal Entity               on behalf of whom a Contribution has been received by Licensor and               subsequently incorporated within the Work.                     2. Grant of Copyright License. Subject to the terms and conditions of               this License, each Contributor hereby grants to You a perpetual,               worldwide, non-exclusive, no-charge, royalty-free, irrevocable               copyright license to reproduce, prepare Derivative Works of,               publicly display, publicly perform, sublicense, and distribute the               Work and such Derivative Works in Source or Object form.                     3. Grant of Patent License. Subject to the terms and conditions of               this License, each Contributor hereby grants to You a perpetual,               worldwide, non-exclusive, no-charge, royalty-free, irrevocable               (except as stated in this section) patent license to make, have made,               use, offer to sell, sell, import, and otherwise transfer the Work,               where such license applies only to those patent claims licensable               by such Contributor that are necessarily infringed by their               Contribution(s) alone or by combination of their Contribution(s)               with the Work to which such Contribution(s) was submitted. If You               institute patent litigation against any entity (including a               cross-claim or counterclaim in a lawsuit) alleging that the Work               or a Contribution incorporated within the Work constitutes direct               or contributory patent infringement, then any patent licenses               granted to You under this License for that Work shall terminate               as of the date such litigation is filed.                     4. Redistribution. You may reproduce and distribute copies of the               Work or Derivative Works thereof in any medium, with or without               modifications, and in Source or Object form, provided that You               meet the following conditions:                        (a) You must give any other recipients of the Work or                   Derivative Works a copy of this License; and                        (b) You must cause any modified files to carry prominent notices                   stating that You changed the files; and                        (c) You must retain, in the Source form of any Derivative Works                   that You distribute, all copyright, patent, trademark, and                   attribution notices from the Source form of the Work,                   excluding those notices that do not pertain to any part of                   the Derivative Works; and                        (d) If the Work includes a \"NOTICE\" text file as part of its                   distribution, then any Derivative Works that You distribute must                   include a readable copy of the attribution notices contained                   within such NOTICE file, excluding those notices that do not                   pertain to any part of the Derivative Works, in at least one                   of the following places: within a NOTICE text file distributed                   as part of the Derivative Works; within the Source form or                   documentation, if provided along with the Derivative Works; or,                   within a display generated by the Derivative Works, if and                   wherever such third-party notices normally appear. The contents                   of the NOTICE file are for informational purposes only and                   do not modify the License. You may add Your own attribution                   notices within Derivative Works that You distribute, alongside                   or as an addendum to the NOTICE text from the Work, provided                   that such additional attribution notices cannot be construed                   as modifying the License.                        You may add Your own copyright statement to Your modifications and               may provide additional or different license terms and conditions               for use, reproduction, or distribution of Your modifications, or               for any such Derivative Works as a whole, provided Your use,               reproduction, and distribution of the Work otherwise complies with               the conditions stated in this License.                     5. Submission of Contributions. Unless You explicitly state otherwise,               any Contribution intentionally submitted for inclusion in the Work               by You to the Licensor shall be under the terms and conditions of               this License, without any additional terms or conditions.               Notwithstanding the above, nothing herein shall supersede or modify               the terms of any separate license agreement you may have executed               with Licensor regarding such Contributions.                     6. Trademarks. This License does not grant permission to use the trade               names, trademarks, service marks, or product names of the Licensor,               except as required for reasonable and customary use in describing the               origin of the Work and reproducing the content of the NOTICE file.                     7. Disclaimer of Warranty. Unless required by applicable law or               agreed to in writing, Licensor provides the Work (and each               Contributor provides its Contributions) on an \"AS IS\" BASIS,               WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or               implied, including, without limitation, any warranties or conditions               of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A               PARTICULAR PURPOSE. You are solely responsible for determining the               appropriateness of using or redistributing the Work and assume any               risks associated with Your exercise of permissions under this License.                     8. Limitation of Liability. In no event and under no legal theory,               whether in tort (including negligence), contract, or otherwise,               unless required by applicable law (such as deliberate and grossly               negligent acts) or agreed to in writing, shall any Contributor be               liable to You for damages, including any direct, indirect, special,               incidental, or consequential damages of any character arising as a               result of this License or out of the use or inability to use the               Work (including but not limited to damages for loss of goodwill,               work stoppage, computer failure or malfunction, or any and all               other commercial damages or losses), even if such Contributor               has been advised of the possibility of such damages.                     9. Accepting Warranty or Additional Liability. While redistributing               the Work or Derivative Works thereof, You may choose to offer,               and charge a fee for, acceptance of support, warranty, indemnity,               or other liability obligations and/or rights consistent with this               License. However, in accepting such obligations, You may act only               on Your own behalf and on Your sole responsibility, not on behalf               of any other Contributor, and only if You agree to indemnify,               defend, and hold each Contributor harmless for any liability               incurred by, or claims asserted against, such Contributor by reason               of your accepting any such warranty or additional liability.                     END OF TERMS AND CONDITIONS                     APPENDIX: How to apply the Apache License to your work.                        To apply the Apache License to your work, attach the following               boilerplate notice, with the fields enclosed by brackets \"[]\"               replaced with your own identifying information. (Don't include               the brackets!)  The text should be enclosed in the appropriate               comment syntax for the file format. We also recommend that a               file or class name and description of purpose be included on the               same \"printed page\" as the copyright notice for easier               identification within third-party archives.                     Copyright 2024 kaiko.ai                     Licensed under the Apache License, Version 2.0 (the \"License\");            you may not use this file except in compliance with the License.            You may obtain a copy of the License at                         http://www.apache.org/licenses/LICENSE-2.0                     Unless required by applicable law or agreed to in writing, software            distributed under the License is distributed on an \"AS IS\" BASIS,            WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.            See the License for the specific language governing permissions and            limitations under the License.         ",
    "summary": "Evaluation Framework for oncology foundation models.",
    "version": "0.1.8",
    "project_urls": {
        "Documentation": "https://kaiko-ai.github.io/eva/dev/",
        "Homepage": "https://kaiko-ai.github.io/eva/dev/",
        "Repository": "https://github.com/kaiko-ai/eva"
    },
    "split_keywords": [
        "machine-learning",
        " evaluation-framework",
        " oncology",
        " foundation-models"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "88ca982691b8df0ccd1cbb4fd91a882e9f3dfa03fbb3b5b06756cd865977552d",
                "md5": "a32bf7b215242d1c2d6f1d5cb774da22",
                "sha256": "2d4aba5d1abd4b8a0895db082102c56f66d8c1e9fd94459961dd638614e4e3b0"
            },
            "downloads": -1,
            "filename": "kaiko_eva-0.1.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a32bf7b215242d1c2d6f1d5cb774da22",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 201117,
            "upload_time": "2024-12-20T11:19:52",
            "upload_time_iso_8601": "2024-12-20T11:19:52.526709Z",
            "url": "https://files.pythonhosted.org/packages/88/ca/982691b8df0ccd1cbb4fd91a882e9f3dfa03fbb3b5b06756cd865977552d/kaiko_eva-0.1.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6694507067dbfbd4e95327cfadd76b0dfc5f8e3d86b1a0d3fda7168d79ed5de1",
                "md5": "938601d98ba4eeba4d969d33491e8fcb",
                "sha256": "85bc858504d2e5a02d485a85f9fa937e1df3615afac5549b087add51fad15e24"
            },
            "downloads": -1,
            "filename": "kaiko_eva-0.1.8.tar.gz",
            "has_sig": false,
            "md5_digest": "938601d98ba4eeba4d969d33491e8fcb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 168588,
            "upload_time": "2024-12-20T11:19:55",
            "upload_time_iso_8601": "2024-12-20T11:19:55.481097Z",
            "url": "https://files.pythonhosted.org/packages/66/94/507067dbfbd4e95327cfadd76b0dfc5f8e3d86b1a0d3fda7168d79ed5de1/kaiko_eva-0.1.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-20 11:19:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kaiko-ai",
    "github_project": "eva",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "kaiko-eva"
}
        
Elapsed time: 0.38341s