from urllib.request import urlopen
from PIL import Image
import timm
# get example histology image
img = Image.open(
urlopen(
"https://github.com/owkin/HistoSSLscaling/raw/main/assets/example.tif"
)
)
# load model from the hub
model = timm.create_model(
model_name="hf-hub:1aurent/vit_small_patch16_256.tcga_brca_dino",
pretrained=True,
).eval()
# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
output = model(transforms(img).unsqueeze(0)) # output is (batch_size, num_features) shaped tensor
Citation
@misc{chen2022selfsupervised,
title = {Self-Supervised Vision Transformers Learn Visual Concepts in Histopathology},
author = {Richard J. Chen and Rahul G. Krishnan},
year = {2022},
eprint = {2203.00585},
archiveprefix = {arXiv},
primaryclass = {cs.CV}
}
Runs of 1aurent vit_small_patch16_256.tcga_brca_dino on huggingface.co
106
Total runs
-4
24-hour runs
-4
3-day runs
-4
7-day runs
36
30-day runs
More Information About vit_small_patch16_256.tcga_brca_dino huggingface.co Model
More vit_small_patch16_256.tcga_brca_dino license Visit here:
vit_small_patch16_256.tcga_brca_dino huggingface.co is an AI model on huggingface.co that provides vit_small_patch16_256.tcga_brca_dino's model effect (), which can be used instantly with this 1aurent vit_small_patch16_256.tcga_brca_dino model. huggingface.co supports a free trial of the vit_small_patch16_256.tcga_brca_dino model, and also provides paid use of the vit_small_patch16_256.tcga_brca_dino. Support call vit_small_patch16_256.tcga_brca_dino model through api, including Node.js, Python, http.
vit_small_patch16_256.tcga_brca_dino huggingface.co is an online trial and call api platform, which integrates vit_small_patch16_256.tcga_brca_dino's modeling effects, including api services, and provides a free online trial of vit_small_patch16_256.tcga_brca_dino, you can try vit_small_patch16_256.tcga_brca_dino online for free by clicking the link below.
1aurent vit_small_patch16_256.tcga_brca_dino online free url in huggingface.co:
vit_small_patch16_256.tcga_brca_dino is an open source model from GitHub that offers a free installation service, and any user can find vit_small_patch16_256.tcga_brca_dino on GitHub to install. At the same time, huggingface.co provides the effect of vit_small_patch16_256.tcga_brca_dino install, users can directly use vit_small_patch16_256.tcga_brca_dino installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
vit_small_patch16_256.tcga_brca_dino install url in huggingface.co: