Add ViT-Up checkpoints: dinov3_splus, dinov3_splus_stage1, dinov3_splus_g28_56, dinov3_base, dinov3_base_stage1, dinov2_small
Browse files- README.md +24 -35
- dinov2_small/config.yaml +16 -0
- dinov2_small/model.safetensors +3 -0
- dinov3_base/config.yaml +26 -0
- dinov3_base/model.safetensors +3 -0
- dinov3_base_stage1/config.yaml +26 -0
- dinov3_base_stage1/model.safetensors +3 -0
- dinov3_splus/config.yaml +26 -0
- dinov3_splus/model.safetensors +3 -0
- dinov3_splus_g28_56/config.yaml +26 -0
- dinov3_splus_g28_56/model.safetensors +3 -0
- dinov3_splus_stage1/config.yaml +26 -0
- dinov3_splus_stage1/model.safetensors +3 -0
README.md
CHANGED
|
@@ -7,62 +7,51 @@ pipeline_tag: image-feature-extraction
|
|
| 7 |
|
| 8 |
**ViT-Up** is an implicit feature upsampler for Vision Transformers that predicts backbone-aligned features at arbitrary continuous image coordinates.
|
| 9 |
|
| 10 |
-
This repository provides pretrained ViT-Up weights for DINOv3-S+ and DINOv3-B.
|
| 11 |
-
|
| 12 |
- **Paper**: [ViT-Up: Faithful Feature Upsampling for Vision Transformers](https://huggingface.co/papers/2606.14024)
|
| 13 |
- **Project page**: https://vitup.papers.discuna.com/
|
| 14 |
- **Code**: https://github.com/krispinwandel/vit-up
|
| 15 |
|
| 16 |
-
##
|
| 17 |
|
| 18 |
-
ViT-Up
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
-
#
|
| 26 |
-
# - vit_up_dinov3_splus
|
| 27 |
-
# - vit_up_dinov3_base
|
| 28 |
-
model = torch.hub.load(
|
| 29 |
-
"krispinwandel/vit-up",
|
| 30 |
-
"vit_up_dinov3_splus",
|
| 31 |
-
pretrained=True,
|
| 32 |
-
trust_repo=True,
|
| 33 |
-
device=device,
|
| 34 |
-
).eval()
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
|
| 39 |
-
|
| 40 |
-
features = model(images, query_coords)
|
| 41 |
|
| 42 |
-
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
#
|
| 45 |
-
model.set_images(images)
|
| 46 |
-
features = []
|
| 47 |
-
query_chunk_size = 10
|
| 48 |
-
for i in range(0, query_coords.shape[1], query_chunk_size):
|
| 49 |
-
chunk_coords = query_coords[:, i : i + query_chunk_size]
|
| 50 |
-
chunk_features = model(query_coords=chunk_coords)
|
| 51 |
-
features.append(chunk_features)
|
| 52 |
-
features = torch.cat(features, dim=1)
|
| 53 |
-
print(features.shape) # (B, N_queries, D)
|
| 54 |
```
|
| 55 |
|
|
|
|
|
|
|
| 56 |
## Citation
|
| 57 |
|
| 58 |
```bibtex
|
| 59 |
@misc{wandel2026vitupfaithfulfeatureupsampling,
|
| 60 |
-
title={ViT-Up: Faithful Feature Upsampling for Vision Transformers},
|
| 61 |
author={Krispin Wandel and Jingchuan Wang and Hesheng Wang},
|
| 62 |
year={2026},
|
| 63 |
eprint={2606.14024},
|
| 64 |
archivePrefix={arXiv},
|
| 65 |
primaryClass={cs.CV},
|
| 66 |
-
url={https://arxiv.org/abs/2606.14024},
|
| 67 |
}
|
| 68 |
-
```
|
|
|
|
| 7 |
|
| 8 |
**ViT-Up** is an implicit feature upsampler for Vision Transformers that predicts backbone-aligned features at arbitrary continuous image coordinates.
|
| 9 |
|
|
|
|
|
|
|
| 10 |
- **Paper**: [ViT-Up: Faithful Feature Upsampling for Vision Transformers](https://huggingface.co/papers/2606.14024)
|
| 11 |
- **Project page**: https://vitup.papers.discuna.com/
|
| 12 |
- **Code**: https://github.com/krispinwandel/vit-up
|
| 13 |
|
| 14 |
+
## Models
|
| 15 |
|
| 16 |
+
Each folder holds `model.safetensors` (ViT-Up weights and the backbone's LoRA adapters) and `config.yaml`. The frozen backbone is loaded from its own Hugging Face repository.
|
| 17 |
|
| 18 |
+
| Folder | Torch Hub entry point | Backbone | Training |
|
| 19 |
+
|---|---|---|---|
|
| 20 |
+
| `dinov3_splus` | `vit_up_dinov3_splus` | DINOv3-S+ | Stage 2 (main model) |
|
| 21 |
+
| `dinov3_splus_stage1` | `vit_up_dinov3_splus_stage1` | DINOv3-S+ | Stage 1 |
|
| 22 |
+
| `dinov3_splus_g28_56` | `vit_up_dinov3_splus_g28_56` | DINOv3-S+ | Stage 2 at 448 and 896 px (28x28 and 56x56 backbone grids) |
|
| 23 |
+
| `dinov3_base` | `vit_up_dinov3_base` | DINOv3-B | Stage 2 |
|
| 24 |
+
| `dinov3_base_stage1` | – | DINOv3-B | Stage 1 |
|
| 25 |
+
| `dinov2_small` | `vit_up_dinov2_small` | DINOv2-S | Stage 2 |
|
| 26 |
|
| 27 |
+
The top-level `vit_up_dinov3_splus.safetensors` and `vit_up_dinov3_base.safetensors` files are the first release and are used by the [demo Space](https://huggingface.co/spaces/Krispin/vit-up).
|
| 28 |
|
| 29 |
+
## Usage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
```python
|
| 32 |
+
import torch
|
| 33 |
|
| 34 |
+
model = torch.hub.load("krispinwandel/vit-up", "vit_up_dinov3_splus", trust_repo=True)
|
|
|
|
| 35 |
|
| 36 |
+
images = torch.randn(1, 3, 448, 448) # ImageNet-normalized
|
| 37 |
+
query_coords = torch.rand(1, 100, 2) # normalized (x, y) in [0, 1]
|
| 38 |
+
features = model(images, query_coords) # (1, 100, C)
|
| 39 |
|
| 40 |
+
dense = model.dense(images, output_size=448) # (1, 448, 448, C), reusing the encoded image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
```
|
| 42 |
|
| 43 |
+
With the repository installed, `vit_up.inference.ViTUpWrapper("dinov3_splus")` loads the same models.
|
| 44 |
+
|
| 45 |
## Citation
|
| 46 |
|
| 47 |
```bibtex
|
| 48 |
@misc{wandel2026vitupfaithfulfeatureupsampling,
|
| 49 |
+
title={ViT-Up: Faithful Feature Upsampling for Vision Transformers},
|
| 50 |
author={Krispin Wandel and Jingchuan Wang and Hesheng Wang},
|
| 51 |
year={2026},
|
| 52 |
eprint={2606.14024},
|
| 53 |
archivePrefix={arXiv},
|
| 54 |
primaryClass={cs.CV},
|
| 55 |
+
url={https://arxiv.org/abs/2606.14024},
|
| 56 |
}
|
| 57 |
+
```
|
dinov2_small/config.yaml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
backbone: facebook/dinov2-small
|
| 2 |
+
backbone_revision: ed25f3a31f01632728cabb09d1542f84ab7b0056
|
| 3 |
+
lora: null
|
| 4 |
+
image_size: 448
|
| 5 |
+
vit_up:
|
| 6 |
+
_target_: vit_up.model.ViTUp
|
| 7 |
+
dim: 384
|
| 8 |
+
num_heads: 6
|
| 9 |
+
layer_indices:
|
| 10 |
+
- 0
|
| 11 |
+
- 2
|
| 12 |
+
- 4
|
| 13 |
+
- 6
|
| 14 |
+
- 8
|
| 15 |
+
- 10
|
| 16 |
+
- 12
|
dinov2_small/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6e4101eef49bd0bcb19187db3cf9a11e96f9736a8eaaf0e73e14f103f3a4ef72
|
| 3 |
+
size 97124760
|
dinov3_base/config.yaml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
backbone: facebook/dinov3-vitb16-pretrain-lvd1689m
|
| 2 |
+
backbone_revision: 5931719e67bbdb9737e363e781fb0c67687896bc
|
| 3 |
+
lora:
|
| 4 |
+
r: 16
|
| 5 |
+
lora_alpha: 32
|
| 6 |
+
lora_dropout: 0.05
|
| 7 |
+
bias: none
|
| 8 |
+
target_modules:
|
| 9 |
+
- patch_embeddings
|
| 10 |
+
- q_proj
|
| 11 |
+
- k_proj
|
| 12 |
+
- v_proj
|
| 13 |
+
- o_proj
|
| 14 |
+
image_size: 448
|
| 15 |
+
vit_up:
|
| 16 |
+
_target_: vit_up.model.ViTUp
|
| 17 |
+
dim: 768
|
| 18 |
+
num_heads: 12
|
| 19 |
+
layer_indices:
|
| 20 |
+
- 0
|
| 21 |
+
- 2
|
| 22 |
+
- 4
|
| 23 |
+
- 6
|
| 24 |
+
- 8
|
| 25 |
+
- 10
|
| 26 |
+
- 12
|
dinov3_base/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3cb41ab6af3d73ff1932aa4435b6fa209190c9a065b647837a12241f68b44d34
|
| 3 |
+
size 391332936
|
dinov3_base_stage1/config.yaml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
backbone: facebook/dinov3-vitb16-pretrain-lvd1689m
|
| 2 |
+
backbone_revision: 5931719e67bbdb9737e363e781fb0c67687896bc
|
| 3 |
+
lora:
|
| 4 |
+
r: 16
|
| 5 |
+
lora_alpha: 32
|
| 6 |
+
lora_dropout: 0.05
|
| 7 |
+
bias: none
|
| 8 |
+
target_modules:
|
| 9 |
+
- patch_embeddings
|
| 10 |
+
- q_proj
|
| 11 |
+
- k_proj
|
| 12 |
+
- v_proj
|
| 13 |
+
- o_proj
|
| 14 |
+
image_size: 448
|
| 15 |
+
vit_up:
|
| 16 |
+
_target_: vit_up.model.ViTUp
|
| 17 |
+
dim: 768
|
| 18 |
+
num_heads: 12
|
| 19 |
+
layer_indices:
|
| 20 |
+
- 0
|
| 21 |
+
- 2
|
| 22 |
+
- 4
|
| 23 |
+
- 6
|
| 24 |
+
- 8
|
| 25 |
+
- 10
|
| 26 |
+
- 12
|
dinov3_base_stage1/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:432efaaa529037d39faedbc591a5ff2885c56f31cf6a428d67513c183d829126
|
| 3 |
+
size 391332936
|
dinov3_splus/config.yaml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
backbone: facebook/dinov3-vits16plus-pretrain-lvd1689m
|
| 2 |
+
backbone_revision: c93d816fc9e567563bc068f01475bec89cc634a6
|
| 3 |
+
lora:
|
| 4 |
+
r: 16
|
| 5 |
+
lora_alpha: 32
|
| 6 |
+
lora_dropout: 0.05
|
| 7 |
+
bias: none
|
| 8 |
+
target_modules:
|
| 9 |
+
- patch_embeddings
|
| 10 |
+
- q_proj
|
| 11 |
+
- k_proj
|
| 12 |
+
- v_proj
|
| 13 |
+
- o_proj
|
| 14 |
+
image_size: 448
|
| 15 |
+
vit_up:
|
| 16 |
+
_target_: vit_up.model.ViTUp
|
| 17 |
+
dim: 384
|
| 18 |
+
num_heads: 6
|
| 19 |
+
layer_indices:
|
| 20 |
+
- 0
|
| 21 |
+
- 2
|
| 22 |
+
- 4
|
| 23 |
+
- 6
|
| 24 |
+
- 8
|
| 25 |
+
- 10
|
| 26 |
+
- 12
|
dinov3_splus/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:da128ce3f59173499a756af8f96a13359b31f75af599c0c3088439e64c66ee43
|
| 3 |
+
size 99570800
|
dinov3_splus_g28_56/config.yaml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
backbone: facebook/dinov3-vits16plus-pretrain-lvd1689m
|
| 2 |
+
backbone_revision: c93d816fc9e567563bc068f01475bec89cc634a6
|
| 3 |
+
lora:
|
| 4 |
+
r: 16
|
| 5 |
+
lora_alpha: 32
|
| 6 |
+
lora_dropout: 0.05
|
| 7 |
+
bias: none
|
| 8 |
+
target_modules:
|
| 9 |
+
- patch_embeddings
|
| 10 |
+
- q_proj
|
| 11 |
+
- k_proj
|
| 12 |
+
- v_proj
|
| 13 |
+
- o_proj
|
| 14 |
+
image_size: 896
|
| 15 |
+
vit_up:
|
| 16 |
+
_target_: vit_up.model.ViTUp
|
| 17 |
+
dim: 384
|
| 18 |
+
num_heads: 6
|
| 19 |
+
layer_indices:
|
| 20 |
+
- 0
|
| 21 |
+
- 2
|
| 22 |
+
- 4
|
| 23 |
+
- 6
|
| 24 |
+
- 8
|
| 25 |
+
- 10
|
| 26 |
+
- 12
|
dinov3_splus_g28_56/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6d32ceeba2a007d103c0f7bf9a356505e22c2b62447aece1ec35565a8f03c39e
|
| 3 |
+
size 99570800
|
dinov3_splus_stage1/config.yaml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
backbone: facebook/dinov3-vits16plus-pretrain-lvd1689m
|
| 2 |
+
backbone_revision: c93d816fc9e567563bc068f01475bec89cc634a6
|
| 3 |
+
lora:
|
| 4 |
+
r: 16
|
| 5 |
+
lora_alpha: 32
|
| 6 |
+
lora_dropout: 0.05
|
| 7 |
+
bias: none
|
| 8 |
+
target_modules:
|
| 9 |
+
- patch_embeddings
|
| 10 |
+
- q_proj
|
| 11 |
+
- k_proj
|
| 12 |
+
- v_proj
|
| 13 |
+
- o_proj
|
| 14 |
+
image_size: 448
|
| 15 |
+
vit_up:
|
| 16 |
+
_target_: vit_up.model.ViTUp
|
| 17 |
+
dim: 384
|
| 18 |
+
num_heads: 6
|
| 19 |
+
layer_indices:
|
| 20 |
+
- 0
|
| 21 |
+
- 2
|
| 22 |
+
- 4
|
| 23 |
+
- 6
|
| 24 |
+
- 8
|
| 25 |
+
- 10
|
| 26 |
+
- 12
|
dinov3_splus_stage1/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dbc9dd8242fb22e27da506ea1c74015919637557fc584b3ed5210f6b47d9a6e6
|
| 3 |
+
size 99570800
|