Update README.md
Browse files
README.md
CHANGED
@@ -33,15 +33,18 @@ from urllib.request import urlopen
|
|
33 |
from PIL import Image
|
34 |
import timm
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
39 |
|
|
|
40 |
model = timm.create_model(
|
41 |
-
"hf-hub:1aurent/vit_base_patch16_224.owkin_pancancer",
|
42 |
pretrained=True,
|
43 |
-
)
|
44 |
-
model = model.eval()
|
45 |
|
46 |
# get model specific transforms (normalization, resize)
|
47 |
data_config = timm.data.resolve_model_data_config(model)
|
|
|
33 |
from PIL import Image
|
34 |
import timm
|
35 |
|
36 |
+
# get example histology image
|
37 |
+
img = Image.open(
|
38 |
+
urlopen(
|
39 |
+
"https://github.com/owkin/HistoSSLscaling/raw/main/assets/example.tif"
|
40 |
+
)
|
41 |
+
)
|
42 |
|
43 |
+
# load model from the hub
|
44 |
model = timm.create_model(
|
45 |
+
model_name="hf-hub:1aurent/vit_base_patch16_224.owkin_pancancer",
|
46 |
pretrained=True,
|
47 |
+
).eval()
|
|
|
48 |
|
49 |
# get model specific transforms (normalization, resize)
|
50 |
data_config = timm.data.resolve_model_data_config(model)
|