Instructions to use timm/swin_small_patch4_window7_224.ms_in22k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use timm/swin_small_patch4_window7_224.ms_in22k with timm:
import timm model = timm.create_model("hf-hub:timm/swin_small_patch4_window7_224.ms_in22k", pretrained=True) - Transformers
How to use timm/swin_small_patch4_window7_224.ms_in22k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="timm/swin_small_patch4_window7_224.ms_in22k") 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/swin_small_patch4_window7_224.ms_in22k") model = AutoModelForImageClassification.from_pretrained("timm/swin_small_patch4_window7_224.ms_in22k", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download config.json from timm/swin_small_patch4_window7_224.ms_in22k: direct link, hf CLI and curl.
- Browser
- Download file 641 Bytes
-
https://huggingface.co/timm/swin_small_patch4_window7_224.ms_in22k/resolve/main/config.json
- Command line
-
hf download hf://timm/swin_small_patch4_window7_224.ms_in22k/config.json
-
curl -L -o config.json https://huggingface.co/timm/swin_small_patch4_window7_224.ms_in22k/resolve/main/config.json
641 Bytes
| { | |
| "architecture": "swin_small_patch4_window7_224", | |
| "num_classes": 21841, | |
| "num_features": 768, | |
| "global_pool": "avg", | |
| "pretrained_cfg": { | |
| "tag": "ms_in22k", | |
| "custom_load": false, | |
| "input_size": [ | |
| 3, | |
| 224, | |
| 224 | |
| ], | |
| "fixed_input_size": true, | |
| "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": 21841, | |
| "pool_size": [ | |
| 7, | |
| 7 | |
| ], | |
| "first_conv": "patch_embed.proj", | |
| "classifier": "head.fc", | |
| "license": "mit" | |
| } | |
| } |