1aurent commited on
Commit
8a13ade
·
verified ·
1 Parent(s): 5e74787

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +49 -1
README.md CHANGED
@@ -1,8 +1,56 @@
1
  ---
2
  tags:
3
- - image-classification
4
  - timm
 
 
5
  library_name: timm
6
  license: apache-2.0
7
  ---
 
8
  # Model card for vit_small_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_small_patch14_224.dinobloom
11
+
12
+ ![](https://github.com/marrlab/DinoBloom/blob/9ea2f950e1f016cd7f899b3ed025d12b6a355d9f/media/overview.png?raw=true)
13
+
14
+ ## Model Usage
15
+
16
+ ### Image Embeddings
17
+
18
+ ```python
19
+ from urllib.request import urlopen
20
+ from PIL import Image
21
+ import timm
22
+
23
+ # get example histology image
24
+ img = Image.open(
25
+ urlopen(
26
+ "https://raw.githubusercontent.com/zxaoyou/segmentation_WBC/master/Dataset%201/001.bmp
27
+ )
28
+ )
29
+
30
+ # load model from the hub
31
+ model = timm.create_model(
32
+ model_name="hf-hub:1aurent/vit_small_patch14_224.dinobloom",
33
+ pretrained=True,
34
+ ).eval()
35
+
36
+ # get model specific transforms (normalization, resize)
37
+ data_config = timm.data.resolve_model_data_config(model)
38
+ transforms = timm.data.create_transform(**data_config, is_training=False)
39
+
40
+ data = transforms(img).unsqueeze(0) # input is a (batch_size, num_channels, img_size, img_size) shaped tensor
41
+ output = model(data) # output is a (batch_size, num_features) shaped tensor
42
+ ```
43
+
44
+
45
+ ## Citation
46
+
47
+ ```bibtex
48
+ @misc{koch2024dinobloom,
49
+ title = {DinoBloom: A Foundation Model for Generalizable Cell Embeddings in Hematology},
50
+ 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},
51
+ year = {2024},
52
+ eprint = {2404.05022},
53
+ archivePrefix = {arXiv},
54
+ primaryClass = {cs.CV}
55
+ }
56
+ ```