Skip to content

Commit 5ce8047

Browse files
committed
Added info and removed git dependencies (conch, musk) to prepare pypi upload
1 parent b445cef commit 5ce8047

4 files changed

Lines changed: 32 additions & 6 deletions

File tree

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Tile-level Histopathology image Understanding benchmark
33

4-
<img src="docs/banner.png" />
4+
<img src="https://raw.githubusercontent.com/MICS-Lab/thunder/main/docs/banner.png" />
55

66
<div align="center">
77

@@ -19,7 +19,7 @@ We introduce **THUNDER**, a comprehensive benchmark designed to rigorously compa
1919

2020
We propose a benchmark to compare and study foundation models across three axes: (i) downstream task performance, (ii) feature space comparisons, and (iii) uncertainty and robustness. Our current version integrates 23 foundation models, vision-only, vision-language, trained on pathology or natural images, on 16 datasets covering different magnifications and organs. THUNDER also supports the use of new user-defined models for direct comparisons.
2121

22-
<img src="docs/overview.png" />
22+
<img src="https://raw.githubusercontent.com/MICS-Lab/thunder/main/docs/overview.png" />
2323

2424

2525
## Usage
@@ -73,3 +73,10 @@ export THUNDER_BASE_DATA_FOLDER="/path/to/your/data/folder"
7373
```
7474

7575
Replace `/path/to/your/data/folder` with your desired storage directory.
76+
77+
If you want to use the CONCH and MUSK models, you should install them as follows:
78+
79+
```console
80+
pip install git+https://github.com/Mahmoodlab/CONCH.git # CONCH
81+
pip install git+https://github.com/lilab-stanford/MUSK.git # MUSK
82+
```

docs/getting_started.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ export THUNDER_BASE_DATA_FOLDER=/path/to/thunder_base_data_folder
2121
Without this environment variable, the package will not work. The folder should be empty and the package will create the necessary subfolders. We will save datasets, foundation models, pre-computed embeddings and output files from ran tasks. Importantly, you will be able to find the output file for a task at the following location:
2222
`$THUNDER_BASE_DATA_FOLDER/outputs/res/<dataset>/<model>/<task>/<adaptation_type>/outputs.json`
2323

24+
If you want to use the CONCH and MUSK models, you should install them as follows:
25+
26+
```console
27+
pip install git+https://github.com/Mahmoodlab/CONCH.git # CONCH
28+
pip install git+https://github.com/lilab-stanford/MUSK.git # MUSK
29+
```
30+
2431
## CLI Usage
2532

2633
You can run the following command to see all available options,

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
name="thundr",
55
version="0.1.0",
66
description="THUNDER: Tile-level Histopathology image UNDERstanding benchmark",
7+
long_description=open("README.md").read(),
8+
long_description_content_type="text/markdown",
9+
url="https://github.com/MICS-Lab/thunder",
10+
license="CC-BY-4.0",
711
package_dir={"": "src"},
812
packages=find_packages(where="src"),
913
install_requires=[
@@ -39,8 +43,6 @@
3943
"wilds==2.0.0",
4044
"kornia==0.8.0",
4145
"typer==0.15.3",
42-
"conch @ git+https://github.com/Mahmoodlab/CONCH.git",
43-
"musk @ git+https://github.com/lilab-stanford/MUSK.git",
4446
],
4547
extras_require={
4648
"dev": ["pytest"],

src/thunder/models/pretrained_models.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,12 @@ def get_from_open_clip(ckpt_path: str):
354354
355355
:param ckpt_path: path to the stored checkpoint.
356356
"""
357-
from conch.open_clip_custom import create_model_from_pretrained
357+
try:
358+
from conch.open_clip_custom import create_model_from_pretrained
359+
except ImportError:
360+
raise ImportError(
361+
"In order to use CONCH, please run the following: 'pip install git+https://github.com/Mahmoodlab/CONCH.git'"
362+
)
358363

359364
model, transform = create_model_from_pretrained("conch_ViT-B-16", ckpt_path)
360365

@@ -417,7 +422,12 @@ def get_musk(ckpt_path: str):
417422
418423
:ckpt_path: path to the stored checkpoint.
419424
"""
420-
from musk import utils, modeling
425+
try:
426+
from musk import utils, modeling
427+
except ImportError:
428+
raise ImportError(
429+
"In order to use MUSK, please run the following: 'pip install git+https://github.com/lilab-stanford/MUSK.git'"
430+
)
421431
from timm.data.constants import IMAGENET_INCEPTION_MEAN, IMAGENET_INCEPTION_STD
422432
from torchvision import transforms
423433

0 commit comments

Comments
 (0)