Views
No views yet
anyup_paper.pth, anyup_multi_backbone.pth).config.json, model.safetensors, image processor, pipeline, remote code) and loads with trust_remote_code=True.(B, C, h, w)(B, C, H, W).| Folder | Training features | Source |
|---|---|---|
anyup | DINOv2 ViT-S/14 (paper) | anyup_paper.pth |
anyup-multi-backbone | DINOv2 (S), DINOv2-R (S), CLIP (B), SigLIP (B), ViT-B | anyup_multi_backbone.pth |
model.enable_natten() or AnyUpModel.from_pretrained(..., use_natten=True) to swap in the optional NATTEN kernel (copies Q/K from the MHA checkpoint; windows differ slightly from the paper).1from transformers import pipeline
2from PIL import Image
3import torch
4
5MODEL = "/path/to/AnyUp-transformers/anyup-multi-backbone"
6
7pipe = pipeline(
8 task="image-feature-extraction",
9 model=MODEL,
10 trust_remote_code=True,
11)
12
13image = Image.open("guide.png").convert("RGB")
14lr_features = torch.randn(1024, 16, 16) # any encoder, any C
15hr_features = pipe(image, features=lr_features, return_tensors=True)
16print(hr_features.shape) # (1, 1024, H, W) — H,W match the guide1hr_features = pipe(
2 image,
3 features=lr_features,
4 output_size=(144, 144),
5 q_chunk_size=10,
6 return_tensors=True,
7)pipe = pipeline(model=MODEL, trust_remote_code=True)1from transformers import AutoImageProcessor, AutoModel
2
3processor = AutoImageProcessor.from_pretrained(MODEL, trust_remote_code=True)
4model = AutoModel.from_pretrained(MODEL, trust_remote_code=True)
5
6inputs = processor(images=image, return_tensors="pt")
7outputs = model(
8 pixel_values=inputs["pixel_values"],
9 features=lr_features.unsqueeze(0), # (B, C, h, w)
10 output_size=(144, 144),
11)
12upsampled = outputs.last_hidden_state # (B, C, 144, 144)1guide = torch.randn(1, 3, 224, 224) # ImageNet-normalized
2feats = torch.randn(1, 1024, 16, 16)
3upsampled = pipe(guide, features=feats, return_tensors=True)preprocessor_config.json matches the official inference recipe:| Input | Transform |
|---|---|
| RGB guide | /255, ImageNet mean/std [0.485, 0.456, 0.406] / [0.229, 0.224, 0.225] |
| Resize | off by default (do_resize: false) so native (H, W) is preserved |
| Features | passed through unchanged |
nn.Module tree (image_encoder.*, cross_decode.*, rope.freqs, …), so conversion is a strict load_state_dict.q_chunk_size trades speed for memory. For MHA it is query tokens; for NATTEN it is low-res rows, not query tokens.model.safetensors. Enabling it requires a NATTEN build matching your CUDA / PyTorch versions.1@inproceedings{wimmer2026anyup,
2 title={AnyUp: Universal Feature Upsampling},
3 author={Wimmer, Thomas and Truong, Prune and Rakotosaona, Marie-Julie and Oechsle, Michael and Tombari, Federico and Schiele, Bernt and Lenssen, Jan Eric},
4 booktitle={Proceedings of the International Conference on Learning Representations ({ICLR})},
5 year={2026}
6}