Instructions to use timm/pvt_v2_b1.in1k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use timm/pvt_v2_b1.in1k with timm:
import timm model = timm.create_model("hf-hub:timm/pvt_v2_b1.in1k", pretrained=True) - Transformers
How to use timm/pvt_v2_b1.in1k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="timm/pvt_v2_b1.in1k") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("timm/pvt_v2_b1.in1k") model = AutoModelForImageClassification.from_pretrained("timm/pvt_v2_b1.in1k", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download config.json from timm/pvt_v2_b1.in1k: direct link, hf CLI and curl.
- Browser
- Download file 572 Bytes
-
https://huggingface.co/timm/pvt_v2_b1.in1k/resolve/main/config.json
- Command line
-
hf download hf://timm/pvt_v2_b1.in1k/config.json
-
curl -L -o config.json https://huggingface.co/timm/pvt_v2_b1.in1k/resolve/main/config.json
572 Bytes
| { | |
| "architecture": "pvt_v2_b1", | |
| "num_classes": 1000, | |
| "num_features": 512, | |
| "global_pool": "avg", | |
| "pretrained_cfg": { | |
| "custom_load": false, | |
| "input_size": [ | |
| 3, | |
| 224, | |
| 224 | |
| ], | |
| "fixed_input_size": false, | |
| "interpolation": "bicubic", | |
| "crop_pct": 0.9, | |
| "crop_mode": "center", | |
| "mean": [ | |
| 0.485, | |
| 0.456, | |
| 0.406 | |
| ], | |
| "std": [ | |
| 0.229, | |
| 0.224, | |
| 0.225 | |
| ], | |
| "num_classes": 1000, | |
| "pool_size": [ | |
| 7, | |
| 7 | |
| ], | |
| "first_conv": "patch_embed.proj", | |
| "classifier": "head" | |
| } | |
| } |