Update README.md
Browse files
README.md
CHANGED
@@ -1,8 +1,69 @@
|
|
1 |
---
|
2 |
tags:
|
3 |
-
- image-classification
|
4 |
- timm
|
|
|
|
|
5 |
library_name: timm
|
6 |
license: apache-2.0
|
7 |
---
|
|
|
8 |
# Model card for vit_giant_patch14_224.dinobloom
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
tags:
|
|
|
3 |
- timm
|
4 |
+
- feature-extraction
|
5 |
+
- image-classification
|
6 |
library_name: timm
|
7 |
license: apache-2.0
|
8 |
---
|
9 |
+
|
10 |
# Model card for vit_giant_patch14_224.dinobloom
|
11 |
+
|
12 |
+
![](https://github.com/marrlab/DinoBloom/blob/9ea2f950e1f016cd7f899b3ed025d12b6a355d9f/media/overview.png?raw=true)
|
13 |
+
|
14 |
+
## Model Details
|
15 |
+
|
16 |
+
- **Model Type:** Feature backbone
|
17 |
+
- **Model Stats:**
|
18 |
+
- Params: 1136M (giant)
|
19 |
+
- Image size: 224 x 224 x 3
|
20 |
+
- Patch size: 14 x 14 x 3
|
21 |
+
- **Repository:** [github.com:marrlab/DinoBloom](https://github.com/marrlab/DinoBloom)
|
22 |
+
- **Original Weights:** [Zenodo](https://zenodo.org/records/10908163)
|
23 |
+
- **License:** [Apache License 2.0](https://github.com/marrlab/DinoBloom/blob/main/LICENSE)
|
24 |
+
- **Papers:**
|
25 |
+
- [DinoBloom: A Foundation Model for Generalizable Cell Embeddings in Hematology](https://arxiv.org/abs/2404.05022)
|
26 |
+
|
27 |
+
## Model Usage
|
28 |
+
|
29 |
+
### Image Embeddings
|
30 |
+
|
31 |
+
```python
|
32 |
+
from urllib.request import urlopen
|
33 |
+
from PIL import Image
|
34 |
+
import timm
|
35 |
+
|
36 |
+
# get example histology image
|
37 |
+
img = Image.open(
|
38 |
+
urlopen(
|
39 |
+
"https://raw.githubusercontent.com/zxaoyou/segmentation_WBC/master/Dataset%201/001.bmp"
|
40 |
+
)
|
41 |
+
)
|
42 |
+
|
43 |
+
# load model from the hub
|
44 |
+
model = timm.create_model(
|
45 |
+
model_name="hf-hub:1aurent/vit_giant_patch14_224.dinobloom",
|
46 |
+
pretrained=True,
|
47 |
+
).eval()
|
48 |
+
|
49 |
+
# get model specific transforms (normalization, resize)
|
50 |
+
data_config = timm.data.resolve_model_data_config(model)
|
51 |
+
transforms = timm.data.create_transform(**data_config, is_training=False)
|
52 |
+
|
53 |
+
data = transforms(img).unsqueeze(0) # input is a (batch_size, num_channels, img_size, img_size) shaped tensor
|
54 |
+
output = model(data) # output is a (batch_size, num_features) shaped tensor
|
55 |
+
```
|
56 |
+
|
57 |
+
|
58 |
+
## Citation
|
59 |
+
|
60 |
+
```bibtex
|
61 |
+
@misc{koch2024dinobloom,
|
62 |
+
title = {DinoBloom: A Foundation Model for Generalizable Cell Embeddings in Hematology},
|
63 |
+
author = {Valentin Koch and Sophia J. Wagner and Salome Kazeminia and Ece Sancar and Matthias Hehr and Julia Schnabel and Tingying Peng and Carsten Marr},
|
64 |
+
year = {2024},
|
65 |
+
eprint = {2404.05022},
|
66 |
+
archivePrefix = {arXiv},
|
67 |
+
primaryClass = {cs.CV}
|
68 |
+
}
|
69 |
+
```
|