Views
No views yet
global_pool='avg' over patch tokens; pass global_pool='token' at
creation to reproduce the upstream CLS representation.manifest.json.127cbcec380d.
The vit_small_patch16_lingbot.robbyant architecture is pending in timm (PR); its pretrained cfg resolves the weights
from this repo, so the usage below works on a timm checkout that includes the LingBot entrypoints.1from urllib.request import urlopen
2from PIL import Image
3import timm
4import torch
5
6img = Image.open(urlopen(
7 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
8))
9
10model = timm.create_model('vit_small_patch16_lingbot.robbyant', pretrained=True)
11model = model.eval()
12
13# get model specific transforms (normalization, resize)
14data_config = timm.data.resolve_model_data_config(model)
15transforms = timm.data.create_transform(**data_config, is_training=False)
16
17output = model(transforms(img).unsqueeze(0)) # unsqueeze single image into batch of 1
18
19top5_probabilities, top5_class_indices = torch.topk(output.softmax(dim=1) * 100, k=5)1from urllib.request import urlopen
2from PIL import Image
3import timm
4
5img = Image.open(urlopen(
6 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
7))
8
9model = timm.create_model(
10 'vit_small_patch16_lingbot.robbyant',
11 pretrained=True,
12 features_only=True,
13)
14model = model.eval()
15
16# get model specific transforms (normalization, resize)
17data_config = timm.data.resolve_model_data_config(model)
18transforms = timm.data.create_transform(**data_config, is_training=False)
19
20output = model(transforms(img).unsqueeze(0)) # unsqueeze single image into batch of 1
21
22for o in output:
23 # print shape of each feature map in output
24 print(o.shape)1from urllib.request import urlopen
2from PIL import Image
3import timm
4
5img = Image.open(urlopen(
6 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
7))
8
9model = timm.create_model(
10 'vit_small_patch16_lingbot.robbyant',
11 pretrained=True,
12 num_classes=0, # remove classifier nn.Linear
13)
14model = model.eval()
15
16# get model specific transforms (normalization, resize)
17data_config = timm.data.resolve_model_data_config(model)
18transforms = timm.data.create_transform(**data_config, is_training=False)
19
20output = model(transforms(img).unsqueeze(0)) # output is (batch_size, num_features) shaped tensor
21
22# or equivalently (without needing to set num_classes=0)
23output = model.forward_features(transforms(img).unsqueeze(0))
24# output is unpooled, a (1, 1029, 384) shaped tensor
25
26output = model.forward_head(output, pre_logits=True)
27# output is a (1, num_features) shaped tensor1@article{lingbot-vision2026,
2 title={Vision Pretraining for Dense Spatial Perception},
3 author={Fu, Zelin and Tan, Bin and Sun, Changjiang and Liu, Shaohui and Zheng, Kecheng and Xu, Yinghao and Zhu, Xing and Shen, Yujun and Xue, Nan},
4 journal={arXiv preprint arXiv:2607.05247},
5 year={2026}
6}1@misc{rw2019timm,
2 author = {Ross Wightman},
3 title = {PyTorch Image Models},
4 year = {2019},
5 publisher = {GitHub},
6 journal = {GitHub repository},
7 doi = {10.5281/zenodo.4414861},
8 howpublished = {\url{https://github.com/huggingface/pytorch-image-models}}
9}