Downloads · 30 days
4
8% of all-time downloads
birder-project/naflex_i_vit_so400m_p16_ap_c1_siglip-v2-webli
naflex_i_vit_so400m_p16_ap_c1_siglip-v2-webli is a image classification model from birder-project. Use it when you need a label for an image. It is set up for birder. The card lists the license as apache-2.0.
A NaFlex SoViT 400M/16 image encoder from the SigLIP v2 model by Tschannen et al., converted to the Birder format for image feature extraction. This version preserves the original model weights and architecture for do…
Downloads · 30 days
4
8% of all-time downloads
All-time downloads
50
Public
Repo size
1.7 GB
Likes
0
Public
Click a slice to open those files.
.pt1.7 GB · 100%
From the Hugging Face model README
A NaFlex SoViT 400M/16 image encoder from the SigLIP v2 model by Tschannen et al., converted to the Birder format for image feature extraction. This version preserves the original model weights and architecture for downstream tasks.
See: https://huggingface.co/google/siglip2-so400m-patch16-naflex for further details.
Model Type: Image classification and detection backbone
Model Stats:
Papers:
import birder
from birder.inference.classification import infer_image
# Option 1: manual setup (more control over preprocessing)
net, model_info = birder.load_pretrained_model("naflex_i_vit_so400m_p16_ap_c1_siglip-v2-webli", inference=True)
# Get the image size the model was trained on
size = birder.get_size_from_signature(model_info.signature)
# Create a NaFlex inference transform
patch_size = net.stem_stride
max_seq_len = (size[0] // patch_size) * (size[1] // patch_size)
transform = birder.naflex_transform(patch_size, max_seq_len, model_info.rgb_stats)
# Option 2: helper (quick start with NaFlex preprocessing)
net, model_info, transform = birder.load_pretrained_model_and_transform(
"naflex_i_vit_so400m_p16_ap_c1_siglip-v2-webli",
inference=True,
naflex=True,
)
image = "path/to/image.jpeg" # or a PIL image
out, embedding = infer_image(net, image, transform, return_embedding=True)
# embedding is a NumPy array with shape of (1, 1152)
from PIL import Image
import birder
net, model_info, transform = birder.load_pretrained_model_and_transform("naflex_i_vit_so400m_p16_ap_c1_siglip-v2-webli", inference=True)
image = Image.open("path/to/image.jpeg")
features = net.detection_features(transform(image).unsqueeze(0))
# features is a dict (stage name -> torch.Tensor)
print([(k, v.size()) for k, v in features.items()])
# Output example:
# [('stage1', torch.Size([1, 1152, 16, 16]))]
@misc{dosovitskiy2021imageworth16x16words,
title={An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale},
author={Alexey Dosovitskiy and Lucas Beyer and Alexander Kolesnikov and Dirk Weissenborn and Xiaohua Zhai and Thomas Unterthiner and Mostafa Dehghani and Matthias Minderer and Georg Heigold and Sylvain Gelly and Jakob Uszkoreit and Neil Houlsby},
year={2021},
eprint={2010.11929},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2010.11929},
}
@misc{alabdulmohsin2024gettingvitshapescaling,
title={Getting ViT in Shape: Scaling Laws for Compute-Optimal Model Design},
author={Ibrahim Alabdulmohsin and Xiaohua Zhai and Alexander Kolesnikov and Lucas Beyer},
year={2024},
eprint={2305.13035},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2305.13035},
}
@misc{tschannen2025siglip2multilingualvisionlanguage,
title={SigLIP 2: Multilingual Vision-Language Encoders with Improved Semantic Understanding, Localization, and Dense Features},
author={Michael Tschannen and Alexey Gritsenko and Xiao Wang and Muhammad Ferjad Naeem and Ibrahim Alabdulmohsin and Nikhil Parthasarathy and Talfan Evans and Lucas Beyer and Ye Xia and Basil Mustafa and Olivier Hénaff and Jeremiah Harmsen and Andreas Steiner and Xiaohua Zhai},
year={2025},
eprint={2502.14786},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2502.14786},
}