Views
No views yet
1import timm
2import torch
3import torchvision.transforms as T
4from PIL import Image
5from urllib.request import urlopen
6model = timm.create_model("hf-hub:BVRA/vit_base_patch16_224.ft_df20_224", pretrained=True)
7model = model.eval()
8train_transforms = T.Compose([T.Resize((224, 224)),
9 T.ToTensor(),
10 T.Normalize([0.5, 0.5, 0.5], [0.5, 0.5, 0.5])])
11img = Image.open(PATH_TO_YOUR_IMAGE)
12output = model(train_transforms(img).unsqueeze(0))
13# output is a (1, num_features) shaped tensor1@InProceedings{Picek_2022_WACV,
2 author = {Picek, Lukas and Sulc, Milan and Matas, Jiri and Jeppesen, Thomas S. and Heilmann-Clausen, Jacob and L{e}ss{\o}e, Thomas and Fr{\o}slev, Tobias},
3 title = {Danish Fungi 2020 - Not Just Another Image Recognition Dataset},
4 booktitle = {Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},
5 month = {January},
6 year = {2022},
7 pages = {1525-1535}
8}
9
10@article{picek2022automatic,
11 title={Automatic Fungi Recognition: Deep Learning Meets Mycology},
12 author={Picek, Lukas and Sulc, Milan and Matas, Jiri and Heilmann-Clausen, Jacob and Jeppesen, Thomas S and Lind, Emil},
13 journal={Sensors},
14 volume={22},
15 number={2},
16 pages={633},
17 year={2022},
18 publisher={Multidisciplinary Digital Publishing Institute}
19}