Views
No views yet
1from transformers import AutoModelForImageClassification, AutoImageProcessor
2from urllib.request import urlopen
3from PIL import Image
4
5# get example histology image
6img = Image.open(
7 urlopen(
8 "https://datasets-server.huggingface.co/assets/1aurent/Kather-texture-2016/--/default/train/0/image/image.jpg"
9 )
10)
11
12# load image_processor and model from the hub
13model_name = "1aurent/phikon-distil-vit-tiny-patch16-224-kather2016"
14image_processor = AutoImageProcessor.from_pretrained(model_name)
15model = AutoModelForImageClassification.from_pretrained(model_name)
16
17inputs = image_processor(img, return_tensors="pt")
18outputs = model(**inputs)1@article{Filiot2023.07.21.23292757,
2 author = {Alexandre Filiot and Ridouane Ghermi and Antoine Olivier and Paul Jacob and Lucas Fidon and Alice Mac Kain and Charlie Saillard and Jean-Baptiste Schiratti},
3 title = {Scaling Self-Supervised Learning for Histopathology with Masked Image Modeling},
4 elocation-id = {2023.07.21.23292757},
5 year = {2023},
6 doi = {10.1101/2023.07.21.23292757},
7 publisher = {Cold Spring Harbor Laboratory Press},
8 url = {https://www.medrxiv.org/content/early/2023/09/14/2023.07.21.23292757},
9 eprint = {https://www.medrxiv.org/content/early/2023/09/14/2023.07.21.23292757.full.pdf},
10 journal = {medRxiv}
11}