alt.freeweights.vision / naflexvit_base_patch16_gap.e300_s576_in1k
From: timm <huggingface.co/timm>Newsgroups: alt.freeweights.visionSubject:

naflexvit_base_patch16_gap.e300_s576_in1k

Date: 2026-11-15Commit: 41edaadSigned: 2DC28CC7B26A283B ✓

Image classification model with 87M parameters. Safetensors weights, 693 MB in all. Published by timm under Apache-2.0.

87M params693MBnaflexvit_base_patch16_gap.e300_s576_in1ksafetensorspermissive
FactsParams87MSize693 MBFormatssafetensorsTaskimage classificationLicenseApache-2.0From sourcepermissive
$ fw get timm/naflexvit_base_patch16_gap.e300_s576_in1k
# manifest sha256 806c19278fa8… · 693 MB · 5 files
$ fw verify ./naflexvit_base_patch16_gap.e300_s576_in1k timm/naflexvit_base_patch16_gap.e300_s576_in1k
From sourceHosted (signed)timm/naflexvit_base_patch16_gap.e300_s576_in1kLast check: 2026-11-15 03:31 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Runs with

Ranked by fit to this model (safetensors), then by GitHub stars.

Overview

Size
693 MB
Weights
347 MB (safetensors)
Parameters
87M
Formats
safetensors
Task
image classification
License
Apache-2.0 (permissive)
Files
5, each with a sha256
Publisher
timm
Added
2026-11-15
Section
alt.freeweights.vision
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 03:31 UTCpassed

Model card

From the publisher at commit 41edaad. Shown as plain text with links; images open at the publisher.

Model card for naflexvit_base_patch16_gap.e300_s576_in1k#

A NaFlexViT (Native-Aspect Flexible Vision Transformer) image classification model. This is variant with 2D position embedding is pretrained on ImageNet-1k by Ross Wightman. NaFlexViT is based on the NaFlex ViT changes proposed in SigLip-2 with a number of timm tweaks, enabling training with dynamic batch sizing that maintains native aspect ratios and flexible resolutions w/ variable patch sizes. The model is trained using the NaFlex data loader, which supports variable sequence lengths and resolutions during training. Uses RandAugment, MixUp, CutMix, and grayscale augmentation on top of standard random resize + crop (RRC). Optimized with NAdamW and cosine learning rate schedule.

Training command:

train.py --data-dir /data/imagenet/ --amp --amp-dtype bfloat16 --model <name> --naflex-loader -b 64 --opt nadamw --lr 3e-4 --warmup-lr 0 --sched-on-updates --aa rand-m8-inc1-mstd1.0 --weight-decay .1 --grayscale-prob .1 --drop-path 0.2 --reprob 0 --mixup 0.8 --cutmix 1.0 --remode pixel -j 8

Model Details#

  • Model Type: Image classification / feature backbone
  • Model Stats:
    • Params (M): 86.6
    • GMACs: 55.9
    • Activations (M): 102.3
    • Image size: 384 x 384
  • Papers:
  • Dataset: ImageNet-1k
  • Training:
    • Sequence Lengths: [128, 256, 576, 784, 1024]
    • Epochs: 300
    • Batch Size: 64 per GPU (4 GPUs) @ seq-len 1024
    • Optimizer: NAdamW
    • Learning Rate: 3e-4
    • Weight Decay: 0.1
    • Augmentation: RandAugment (m=8), MixUp (0.8), CutMix (1.0), Grayscale (0.1)
    • Drop Path: 0.2
    • AMP dtype: bfloat16
  • Architecture:
    • Variant: base
    • Patch Size: 16x16
    • Positional Embedding: 2D position embedding
    • Pooling: global average pooling (GAP)

Model Usage#

Image Classification#
from urllib.request import urlopen
from PIL import Image
import timm

img = Image.open(urlopen(
    'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))

model = timm.create_model('naflexvit_base_patch16_gap.e300_s576_in1k', pretrained=True)
model = model.eval()

# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)

output = model(transforms(img).unsqueeze(0))  # unsqueeze single image into batch of 1

top5_probabilities, top5_class_indices = torch.topk(output.softmax(dim=1) * 100, k=5)
Feature Map Extraction#
from urllib.request import urlopen
from PIL import Image
import timm

img = Image.open(urlopen(
    'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))

model = timm.create_model(
    'naflexvit_base_patch16_gap.e300_s576_in1k',
    pretrained=True,
    features_only=True,
)
model = model.eval()

# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)

output = model(transforms(img).unsqueeze(0))  # unsqueeze single image into batch of 1

for o in output:
    # print shape of each feature map in output
    # e.g.:
    #  torch.Size([1, 768, 24, 24])
    #  torch.Size([1, 768, 24, 24])
    #  torch.Size([1, 768, 24, 24])

    print(o.shape)
Image Embeddings#
from urllib.request import urlopen
from PIL import Image
import timm

img = Image.open(urlopen(
    'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))

model = timm.create_model(
    'naflexvit_base_patch16_gap.e300_s576_in1k',
    pretrained=True,
    num_classes=0,  # remove classifier nn.Linear
)
model = model.eval()

# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)

output = model(transforms(img).unsqueeze(0))  # output is (batch_size, num_features) shaped tensor

# or equivalently (without needing to set num_classes=0)

output = model.forward_features(transforms(img).unsqueeze(0))
# output is unpooled, a (1, 580, 768) shaped tensor

output = model.forward_head(output, pre_logits=True)
# output is a (1, num_features) shaped tensor

Model Comparison#

ModelTop-1 AccTop-5 AccParams (M)Eval Seq Len
naflexvit_base_patch16_par_gap.e300_s576_in1k83.6796.4586.63576
naflexvit_base_patch16_parfac_gap.e300_s576_in1k83.6396.4186.46576
naflexvit_base_patch16_gap.e300_s576_in1k83.5096.4686.63576

Citation#

@misc{rw2019timm,
  author = {Ross Wightman},
  title = {PyTorch Image Models},
  year = {2019},
  publisher = {GitHub},
  journal = {GitHub repository},
  doi = {10.5281/zenodo.4414861},
  howpublished = {\url{https://github.com/huggingface/pytorch-image-models}}
}
@article{tschannen2025siglip,
  title={Siglip 2: Multilingual vision-language encoders with improved semantic understanding, localization, and dense features},
  author={Tschannen, Michael and Gritsenko, Alexey and Wang, Xiao and Naeem, Muhammad Ferjad and Alabdulmohsin, Ibrahim and Parthasarathy, Nikhil and Evans, Talfan and Beyer, Lucas and Xia, Ye and Mustafa, Basil and others},
  journal={arXiv preprint arXiv:2502.14786},
  year={2025}
}
@article{dehghani2023navit,
  title={Patch n' Pack: NaViT, a Vision Transformer for any Aspect Ratio and Resolution},
  author={Dehghani, Mostafa and Mustafa, Basil and Djolonga, Josip and Heek, Jonathan and Minderer, Matthias and Caron, Mathilde and Steiner, Andreas and Puigcerver, Joan and Geirhos, Robert and Alabdulmohsin, Ibrahim and others},
  journal={arXiv preprint arXiv:2307.06304},
  year={2023}
}
@article{beyer2022flexivit,
  title={FlexiViT: One Model for All Patch Sizes},
  author={Beyer, Lucas and Izmailov, Pavel and Kolesnikov, Alexander and Caron, Mathilde and Kornblith, Simon and Zhai, Xiaohua and Minderer, Matthias and Tschannen, Michael and Alabdulmohsin, Ibrahim and Pavetic, Filip},
  journal={arXiv preprint arXiv:2212.08013},
  year={2022}
}

Files

5 files · 693 MBWeights 347 MB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 5 files with their sha256
FileSizesha256
.gitattributes1.52 KB11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361
README.md6.81 KB6b306dbb613d07e5b2e29df9ea626acc4658569fa70585a3f013426262c7d136
config.json610 B361ca13014e2a40553cd40284b6fa977bbf90455128a7dad74d2d123cbbe42dc
model.safetensors347 MBcdad909dc2c43470bee09dbada7c0916bc1de912528f0fd22997fcd34a0a4200
pytorch_model.bin347 MBb96dc763f8f28333e26234a35cea8c115db1491d14860f3235f7fd51c4059d39
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
41edaad5c3 pinned now2026-11-15 03:31 UTC5 files · 693 MB

Use it

$ fw get timm/naflexvit_base_patch16_gap.e300_s576_in1k
# manifest sha256 806c19278fa8… · 693 MB · 5 files
$ fw verify ./naflexvit_base_patch16_gap.e300_s576_in1k timm/naflexvit_base_patch16_gap.e300_s576_in1k
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/timm/naflexvit_base_patch16_gap.e300_s576_in1k.json --dir ./naflexvit_base_patch16_gap.e300_s576_in1k $ python3 fw.py verify ./naflexvit_base_patch16_gap.e300_s576_in1k ./timm__naflexvit_base_patch16_gap.e300_s576_in1k.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download timm/naflexvit_base_patch16_gap.e300_s576_in1k --revision 41edaad5c31ffa32c0df8e3f92d1495159390410 --local-dir ./naflexvit_base_patch16_gap.e300_s576_in1k

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
6b306dbb613d07e5b2e29df9ea626acc4658569fa70585a3f013426262c7d136
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: timm <huggingface.co/timm>Newsgroups: alt.freeweights.visionSubject: naflexvit_base_patch16_gap.e300_s576_in1kDate: 2026-11-15Commit: 41edaadSigned: 2DC28CC7B26A283B ✓
Upstream
timm/naflexvit_base_patch16_gap.e300_s576_in1k
Pinned commit
41edaad5c31ffa32c0df8e3f92d1495159390410
Manifest
naflexvit_base_patch16_gap.e300_s576_in1k.json · .minisig
Manifest sha256
806c19278fa8f531fdd6e4cbf3bfb8a5656f3cc9b958263e51b62b896e18a452
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 03:31 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/timm/naflexvit_base_patch16_gap.e300_s576_in1k.json $ curl -O https://freeweights.allternit.com/manifests/timm/naflexvit_base_patch16_gap.e300_s576_in1k.json.minisig $ minisign -Vm naflexvit_base_patch16_gap.e300_s576_in1k.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

No related models in this catalog.Nothing here lists this model as its parent, and it names no parent.
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download timm/naflexvit_base_patch16_gap.e300_s576_in1k
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. naflexvit_base_patch16_gap.e300_s576_in1k.json. Provenance. Takedown history: none.
From: dima806 <huggingface.co/dima806>Subject: ai_vs_real_image_detection
From: legekka <huggingface.co/legekka>Subject: AI-Anime-Image-Detector-ViT
From: onnx-community <huggingface.co/onnx-community>Subject: AI-Anime-Image-Detector-ViT-ONNX
From: AICodexLab <huggingface.co/AICodexLab>Subject: answerdotai-ModernBERT-base-ai-detector
From: onnx-community <huggingface.co/onnx-community>Subject: answerdotai-ModernBERT-base-ai-detector-ONNX
From: onnx-community <huggingface.co/onnx-community>Subject: bart-large-cnn-ONNX