ILSVRC/imagenet-1k
Viewer β’ Updated β’ 1.43M β’ 108k β’ 904
How to use NCPS/progresvit-deit-s-192-240-imagenet1k with timm:
import timm
model = timm.create_model("hf_hub:NCPS/progresvit-deit-s-192-240-imagenet1k", pretrained=True)ImageNet-1K EMA weights for ProgResViT DeiT-S (192 β 240) from ProgResViT: Progressive Resolution and Width for Adaptive Vision Transformers.
Run from the cloned ProgResViT repository root, or add the repository to PYTHONPATH:
import torch
from timm.models import create_model
model = create_model("hf-hub:NCPS/progresvit-deit-s-192-240-imagenet1k", pretrained=True)
model.eval()
x = torch.randn(1, 3, 240, 240)
with torch.inference_mode():
logits, stage = model(x, threshold=0.35)
print(logits.shape) # (1, 1000)
print(stage) # 0 = 192 px / 3 heads; 1 = 240 px / 6 heads
The entropy threshold controls routing. Lower values send more images to the second round; higher values exit more images after the first round.
Download the release checkpoint into checkpoints/:
from huggingface_hub import hf_hub_download
hf_hub_download(
repo_id="NCPS/progresvit-deit-s-192-240-imagenet1k",
filename="progresvit_192_240.pth.tar",
local_dir="checkpoints",
)
Then run the repository evaluator:
python validate.py /path/to/imagenet/val \
--config 192_240 \
--checkpoint checkpoints/progresvit_192_240.pth.tar