Instructions to use belfner/vit_small_patch16_lingbot.robbyant with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use belfner/vit_small_patch16_lingbot.robbyant with timm:
import timm model = timm.create_model("hf_hub:belfner/vit_small_patch16_lingbot.robbyant", pretrained=True) - Transformers
How to use belfner/vit_small_patch16_lingbot.robbyant with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="belfner/vit_small_patch16_lingbot.robbyant")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("belfner/vit_small_patch16_lingbot.robbyant", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add converted LingBot-Vision weights
Browse files- README.md +145 -0
- config.json +36 -0
- manifest.json +94 -0
- model.safetensors +3 -0
- pytorch_model.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- image-feature-extraction
|
| 4 |
+
- timm
|
| 5 |
+
- transformers
|
| 6 |
+
pipeline_tag: image-feature-extraction
|
| 7 |
+
library_name: timm
|
| 8 |
+
license: apache-2.0
|
| 9 |
+
---
|
| 10 |
+
# Model card for vit_small_patch16_lingbot.robbyant
|
| 11 |
+
|
| 12 |
+
A LingBot-Vision ViT-Small/16 image feature encoder. Distilled from the masked-boundary-pretrained ViT-Giant/16 teacher by the paper authors
|
| 13 |
+
and converted to timm's Eva/DINOv3 implementation.
|
| 14 |
+
|
| 15 |
+
## Model Notes
|
| 16 |
+
* Token layout: CLS at index 0, four register tokens at indices 1-4, patch tokens thereafter.
|
| 17 |
+
The pretrained cfg uses `global_pool='avg'` over patch tokens; pass `global_pool='token'` at
|
| 18 |
+
creation to reproduce the upstream CLS representation.
|
| 19 |
+
* fp32 forward outputs match the reference implementation with max abs diff 0.0e+00 on CLS,
|
| 20 |
+
register, and patch tokens at 512x512 and 384x512. Conversion provenance, the pinned source
|
| 21 |
+
revision, and per-partition parity metrics are recorded in `manifest.json`.
|
| 22 |
+
* Converted from https://huggingface.co/robbyant/lingbot-vision-vit-small at revision `127cbcec380d`.
|
| 23 |
+
The `vit_small_patch16_lingbot.robbyant` architecture is pending in timm (PR); its pretrained cfg resolves the weights
|
| 24 |
+
from this repo, so the usage below works on a timm checkout that includes the LingBot entrypoints.
|
| 25 |
+
|
| 26 |
+
## Model Details
|
| 27 |
+
- **Model Type:** Image Feature Encoder
|
| 28 |
+
- **Model Stats:**
|
| 29 |
+
- Params (M): 21.6
|
| 30 |
+
- GMACs: 22.2
|
| 31 |
+
- Activations (M): 43.07
|
| 32 |
+
- Image size: 512 x 512
|
| 33 |
+
- **Original:** https://github.com/robbyant/lingbot-vision
|
| 34 |
+
- **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
| 35 |
+
- **Pretrain Dataset:** 161M-image curated web corpus (see paper)
|
| 36 |
+
- **Papers:**
|
| 37 |
+
- Vision Pretraining for Dense Spatial Perception: https://arxiv.org/abs/2607.05247
|
| 38 |
+
- PyTorch Image Models: https://github.com/huggingface/pytorch-image-models
|
| 39 |
+
|
| 40 |
+
## Model Usage
|
| 41 |
+
### Image Classification
|
| 42 |
+
```python
|
| 43 |
+
from urllib.request import urlopen
|
| 44 |
+
from PIL import Image
|
| 45 |
+
import timm
|
| 46 |
+
import torch
|
| 47 |
+
|
| 48 |
+
img = Image.open(urlopen(
|
| 49 |
+
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
|
| 50 |
+
))
|
| 51 |
+
|
| 52 |
+
model = timm.create_model('vit_small_patch16_lingbot.robbyant', pretrained=True)
|
| 53 |
+
model = model.eval()
|
| 54 |
+
|
| 55 |
+
# get model specific transforms (normalization, resize)
|
| 56 |
+
data_config = timm.data.resolve_model_data_config(model)
|
| 57 |
+
transforms = timm.data.create_transform(**data_config, is_training=False)
|
| 58 |
+
|
| 59 |
+
output = model(transforms(img).unsqueeze(0)) # unsqueeze single image into batch of 1
|
| 60 |
+
|
| 61 |
+
top5_probabilities, top5_class_indices = torch.topk(output.softmax(dim=1) * 100, k=5)
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
### Feature Map Extraction
|
| 65 |
+
```python
|
| 66 |
+
from urllib.request import urlopen
|
| 67 |
+
from PIL import Image
|
| 68 |
+
import timm
|
| 69 |
+
|
| 70 |
+
img = Image.open(urlopen(
|
| 71 |
+
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
|
| 72 |
+
))
|
| 73 |
+
|
| 74 |
+
model = timm.create_model(
|
| 75 |
+
'vit_small_patch16_lingbot.robbyant',
|
| 76 |
+
pretrained=True,
|
| 77 |
+
features_only=True,
|
| 78 |
+
)
|
| 79 |
+
model = model.eval()
|
| 80 |
+
|
| 81 |
+
# get model specific transforms (normalization, resize)
|
| 82 |
+
data_config = timm.data.resolve_model_data_config(model)
|
| 83 |
+
transforms = timm.data.create_transform(**data_config, is_training=False)
|
| 84 |
+
|
| 85 |
+
output = model(transforms(img).unsqueeze(0)) # unsqueeze single image into batch of 1
|
| 86 |
+
|
| 87 |
+
for o in output:
|
| 88 |
+
# print shape of each feature map in output
|
| 89 |
+
print(o.shape)
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
### Image Embeddings
|
| 93 |
+
```python
|
| 94 |
+
from urllib.request import urlopen
|
| 95 |
+
from PIL import Image
|
| 96 |
+
import timm
|
| 97 |
+
|
| 98 |
+
img = Image.open(urlopen(
|
| 99 |
+
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
|
| 100 |
+
))
|
| 101 |
+
|
| 102 |
+
model = timm.create_model(
|
| 103 |
+
'vit_small_patch16_lingbot.robbyant',
|
| 104 |
+
pretrained=True,
|
| 105 |
+
num_classes=0, # remove classifier nn.Linear
|
| 106 |
+
)
|
| 107 |
+
model = model.eval()
|
| 108 |
+
|
| 109 |
+
# get model specific transforms (normalization, resize)
|
| 110 |
+
data_config = timm.data.resolve_model_data_config(model)
|
| 111 |
+
transforms = timm.data.create_transform(**data_config, is_training=False)
|
| 112 |
+
|
| 113 |
+
output = model(transforms(img).unsqueeze(0)) # output is (batch_size, num_features) shaped tensor
|
| 114 |
+
|
| 115 |
+
# or equivalently (without needing to set num_classes=0)
|
| 116 |
+
output = model.forward_features(transforms(img).unsqueeze(0))
|
| 117 |
+
# output is unpooled, a (1, 1029, 384) shaped tensor
|
| 118 |
+
|
| 119 |
+
output = model.forward_head(output, pre_logits=True)
|
| 120 |
+
# output is a (1, num_features) shaped tensor
|
| 121 |
+
```
|
| 122 |
+
|
| 123 |
+
## Model Comparison
|
| 124 |
+
Explore the dataset and runtime metrics of this model in timm [model results](https://github.com/huggingface/pytorch-image-models/tree/main/results).
|
| 125 |
+
|
| 126 |
+
## Citation
|
| 127 |
+
```bibtex
|
| 128 |
+
@article{lingbot-vision2026,
|
| 129 |
+
title={Vision Pretraining for Dense Spatial Perception},
|
| 130 |
+
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},
|
| 131 |
+
journal={arXiv preprint arXiv:2607.05247},
|
| 132 |
+
year={2026}
|
| 133 |
+
}
|
| 134 |
+
```
|
| 135 |
+
```bibtex
|
| 136 |
+
@misc{rw2019timm,
|
| 137 |
+
author = {Ross Wightman},
|
| 138 |
+
title = {PyTorch Image Models},
|
| 139 |
+
year = {2019},
|
| 140 |
+
publisher = {GitHub},
|
| 141 |
+
journal = {GitHub repository},
|
| 142 |
+
doi = {10.5281/zenodo.4414861},
|
| 143 |
+
howpublished = {\url{https://github.com/huggingface/pytorch-image-models}}
|
| 144 |
+
}
|
| 145 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architecture": "vit_small_patch16_lingbot",
|
| 3 |
+
"num_classes": 0,
|
| 4 |
+
"num_features": 384,
|
| 5 |
+
"global_pool": "avg",
|
| 6 |
+
"pretrained_cfg": {
|
| 7 |
+
"tag": "robbyant",
|
| 8 |
+
"custom_load": false,
|
| 9 |
+
"input_size": [
|
| 10 |
+
3,
|
| 11 |
+
512,
|
| 12 |
+
512
|
| 13 |
+
],
|
| 14 |
+
"fixed_input_size": true,
|
| 15 |
+
"interpolation": "bilinear",
|
| 16 |
+
"crop_pct": 1.0,
|
| 17 |
+
"crop_mode": "squash",
|
| 18 |
+
"mean": [
|
| 19 |
+
0.485,
|
| 20 |
+
0.456,
|
| 21 |
+
0.406
|
| 22 |
+
],
|
| 23 |
+
"std": [
|
| 24 |
+
0.229,
|
| 25 |
+
0.224,
|
| 26 |
+
0.225
|
| 27 |
+
],
|
| 28 |
+
"num_classes": 0,
|
| 29 |
+
"pool_size": null,
|
| 30 |
+
"first_conv": "patch_embed.proj",
|
| 31 |
+
"classifier": "head",
|
| 32 |
+
"license": "apache-2.0",
|
| 33 |
+
"origin_url": "https://github.com/robbyant/lingbot-vision",
|
| 34 |
+
"paper_ids": "arXiv:2607.05247"
|
| 35 |
+
}
|
| 36 |
+
}
|
manifest.json
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"variant": "small",
|
| 3 |
+
"arch": "vit_small_patch16_lingbot",
|
| 4 |
+
"tag": "robbyant",
|
| 5 |
+
"source_repo": "robbyant/lingbot-vision-vit-small",
|
| 6 |
+
"source_revision": "127cbcec380de0bcd55bdc1b1fad3819850a6514",
|
| 7 |
+
"source_sha256": "dca36562cb6b0b34504df6edc18fa282c5ef06fb375c3e91d5487247a1096f9d",
|
| 8 |
+
"wrapper_key": "model",
|
| 9 |
+
"source_tensors": 188,
|
| 10 |
+
"converted_tensors": 186,
|
| 11 |
+
"param_count": 21596160,
|
| 12 |
+
"dtypes": [
|
| 13 |
+
"torch.float32"
|
| 14 |
+
],
|
| 15 |
+
"save_dir": "/home/belfner/PycharmProjects/pytorch-image-models/converted/vit_small_patch16_lingbot.robbyant",
|
| 16 |
+
"artifacts": {
|
| 17 |
+
"config.json": "2262dd5a2bd838c83671a33638894af6711712f1f04b6c8ba1a39df8779e5a04",
|
| 18 |
+
"model.safetensors": "f879b5b2352b0925d9ec12bdbfdbfeea4973ea0190f3a80232a9a451bbf895ee",
|
| 19 |
+
"pytorch_model.bin": "1ee09c96c84d9d7fb3332f41984da1b0083f78438652ce1ba02179074082d4cf",
|
| 20 |
+
"README.md": "11ee10680d95dda5f1368bc9f1b68cee14c448cb7af908dbf67fdf65fe620f06"
|
| 21 |
+
},
|
| 22 |
+
"parity": {
|
| 23 |
+
"512x512": {
|
| 24 |
+
"cls": {
|
| 25 |
+
"max_abs": 0.0,
|
| 26 |
+
"mean_abs": 0.0,
|
| 27 |
+
"cos_min": 1.0
|
| 28 |
+
},
|
| 29 |
+
"registers": {
|
| 30 |
+
"max_abs": 0.0,
|
| 31 |
+
"mean_abs": 0.0,
|
| 32 |
+
"cos_min": 1.0
|
| 33 |
+
},
|
| 34 |
+
"patches": {
|
| 35 |
+
"max_abs": 0.0,
|
| 36 |
+
"mean_abs": 0.0,
|
| 37 |
+
"cos_min": 0.9999997615814209
|
| 38 |
+
}
|
| 39 |
+
},
|
| 40 |
+
"384x512": {
|
| 41 |
+
"cls": {
|
| 42 |
+
"max_abs": 0.0,
|
| 43 |
+
"mean_abs": 0.0,
|
| 44 |
+
"cos_min": 1.0000001192092896
|
| 45 |
+
},
|
| 46 |
+
"registers": {
|
| 47 |
+
"max_abs": 0.0,
|
| 48 |
+
"mean_abs": 0.0,
|
| 49 |
+
"cos_min": 0.9999999403953552
|
| 50 |
+
},
|
| 51 |
+
"patches": {
|
| 52 |
+
"max_abs": 0.0,
|
| 53 |
+
"mean_abs": 0.0,
|
| 54 |
+
"cos_min": 0.9999997615814209
|
| 55 |
+
}
|
| 56 |
+
},
|
| 57 |
+
"public_forward_token_pool": {
|
| 58 |
+
"max_abs": 0.0
|
| 59 |
+
},
|
| 60 |
+
"public_forward_avg_pool_smoke": "pass",
|
| 61 |
+
"transform_max_abs": 0.0,
|
| 62 |
+
"real_image": {
|
| 63 |
+
"cls": {
|
| 64 |
+
"max_abs": 0.0,
|
| 65 |
+
"mean_abs": 0.0,
|
| 66 |
+
"cos_min": 1.0
|
| 67 |
+
},
|
| 68 |
+
"registers": {
|
| 69 |
+
"max_abs": 0.0,
|
| 70 |
+
"mean_abs": 0.0,
|
| 71 |
+
"cos_min": 0.9999999403953552
|
| 72 |
+
},
|
| 73 |
+
"patches": {
|
| 74 |
+
"max_abs": 0.0,
|
| 75 |
+
"mean_abs": 0.0,
|
| 76 |
+
"cos_min": 0.9999997019767761
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
},
|
| 80 |
+
"provenance": {
|
| 81 |
+
"converter_sha256": "166732a819c7af4542c50477c5ceeb01f3dc20061fef300f6a4fc437df48640c",
|
| 82 |
+
"timm_root": "/home/belfner/PycharmProjects/pytorch-image-models",
|
| 83 |
+
"timm_commit": "1fb842c917df1edd3c4a7c17edc4fc5588452cc5",
|
| 84 |
+
"timm_dirty": false,
|
| 85 |
+
"reference_root": "/home/belfner/PycharmProjects/pytorch-image-models/lingbot-vision",
|
| 86 |
+
"reference_commit": "151e46321bae4399f8568829f190c7bdec216b49",
|
| 87 |
+
"reference_dirty": false,
|
| 88 |
+
"torch": "2.13.0+cu130",
|
| 89 |
+
"timm_version": "1.0.29.dev0",
|
| 90 |
+
"safetensors": "0.8.0",
|
| 91 |
+
"huggingface_hub": "1.25.1",
|
| 92 |
+
"python": "3.14.0"
|
| 93 |
+
}
|
| 94 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f879b5b2352b0925d9ec12bdbfdbfeea4973ea0190f3a80232a9a451bbf895ee
|
| 3 |
+
size 86401352
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1ee09c96c84d9d7fb3332f41984da1b0083f78438652ce1ba02179074082d4cf
|
| 3 |
+
size 86451723
|