Run this model with HF Jobs
Run zeromodels/deit_base_patch16_224_fb_in1k on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/zeromodels/deit_base_patch16_224_fb_in1k. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/zeromodels/deit_base_patch16_224_fb_in1k on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use zeromodels/deit_base_patch16_224_fb_in1k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/deit_base_patch16_224_fb_in1k with ZeroModels:
# pip install -U zeromodels # ZeroModels is pure Keras 3, so pick a backend: "jax", "torch" or "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" from zeromodels import AutoZModel # AutoZModel reads the repo's model_type and loads the matching class. # For a task head use the matching loader, e.g. AutoZMImageClassify / AutoZMDetect / # AutoZMSemanticSegment / AutoZMTextGenerate (see zeromodels.auto). model = AutoZModel.from_weights("zeromodels/deit_base_patch16_224_fb_in1k") - Keras
How to use zeromodels/deit_base_patch16_224_fb_in1k with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://zeromodels/deit_base_patch16_224_fb_in1k") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899---pipeline_tag: image-classificationlicense: apache-2.0base_model: timm/deit_base_patch16_224.fb_in1klibrary_name: zeromodelstags:- keras- zeromodels- image-classification- deit- backbone- arxiv:2012.12877- pytorch- jax- tf---## ***See [our collection](https://huggingface.co/collections/zeromodels/deit-and-deit3-6a8eaefd844d1822f01d81b2) for all versions of DeiT.***# Run DeiT with Keras 3: JAX, PyTorch, or TensorFlow[](https://github.com/IMvision12/ZeroModels) [](https://imvision12.github.io/ZeroModels/classification_backbones/) [](https://huggingface.co/collections/zeromodels/deit-and-deit3-6a8eaefd844d1822f01d81b2)# zeromodels/deit_base_patch16_224_fb_in1kPaper: [Training data-efficient image transformers and distillation through attention (arXiv:2012.12877)](https://arxiv.org/abs/2012.12877) · [HF Papers](https://huggingface.co/papers/2012.12877)DeiT / DeiT3 are data-efficient ViT variants (distillation token in DeiT; improved training recipe in DeiT3). Same ImageClassify / Model API.For more details on the model, please go to the upstream [model card](https://huggingface.co/timm/deit_base_patch16_224.fb_in1k).Pure-**Keras 3** conversion of [`timm/deit_base_patch16_224.fb_in1k`](https://huggingface.co/timm/deit_base_patch16_224.fb_in1k) for [zeromodels](https://github.com/IMvision12/ZeroModels). One implementation runs unmodified on **TensorFlow / Torch / JAX**.This is an **image-classification / backbone** checkpoint (`DeiTImageClassify` / `DeiTModel`).## ✨ Quick start```pythonimport osos.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"from PIL import Imageimport numpy as npfrom zeromodels.models.deit import DeiTImageClassify, DeiTModelmodel = DeiTImageClassify.from_weights("zeromodels/deit_base_patch16_224_fb_in1k")backbone = DeiTModel.from_weights("zeromodels/deit_base_patch16_224_fb_in1k", as_backbone=True)image = Image.open("your_image.jpg").convert("RGB")image = image.resize((224, 224))x = np.asarray(image, dtype="float32")[None] # (1, H, W, 3)print(model(x).shape) # (1, num_classes)feats = backbone(x)print(len(feats), [tuple(f.shape) for f in feats])```Load any DeiT variant the same way with `from_weights("zeromodels/<variant>")`:| Variant | Hub ||---|---|| `deit3_base_patch16_224_fb_in1k` | [`zeromodels/deit3_base_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit3_base_patch16_224_fb_in1k) || `deit3_base_patch16_224_fb_in22k_ft_in1k` | [`zeromodels/deit3_base_patch16_224_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_base_patch16_224_fb_in22k_ft_in1k) || `deit3_base_patch16_384_fb_in1k` | [`zeromodels/deit3_base_patch16_384_fb_in1k`](https://huggingface.co/zeromodels/deit3_base_patch16_384_fb_in1k) || `deit3_base_patch16_384_fb_in22k_ft_in1k` | [`zeromodels/deit3_base_patch16_384_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_base_patch16_384_fb_in22k_ft_in1k) || `deit3_huge_patch14_224_fb_in1k` | [`zeromodels/deit3_huge_patch14_224_fb_in1k`](https://huggingface.co/zeromodels/deit3_huge_patch14_224_fb_in1k) || `deit3_huge_patch14_224_fb_in22k_ft_in1k` | [`zeromodels/deit3_huge_patch14_224_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_huge_patch14_224_fb_in22k_ft_in1k) || `deit3_large_patch16_224_fb_in1k` | [`zeromodels/deit3_large_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit3_large_patch16_224_fb_in1k) || `deit3_large_patch16_224_fb_in22k_ft_in1k` | [`zeromodels/deit3_large_patch16_224_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_large_patch16_224_fb_in22k_ft_in1k) || `deit3_large_patch16_384_fb_in1k` | [`zeromodels/deit3_large_patch16_384_fb_in1k`](https://huggingface.co/zeromodels/deit3_large_patch16_384_fb_in1k) || `deit3_large_patch16_384_fb_in22k_ft_in1k` | [`zeromodels/deit3_large_patch16_384_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_large_patch16_384_fb_in22k_ft_in1k) || `deit3_medium_patch16_224_fb_in1k` | [`zeromodels/deit3_medium_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit3_medium_patch16_224_fb_in1k) || `deit3_medium_patch16_224_fb_in22k_ft_in1k` | [`zeromodels/deit3_medium_patch16_224_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_medium_patch16_224_fb_in22k_ft_in1k) || `deit3_small_patch16_224_fb_in1k` | [`zeromodels/deit3_small_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit3_small_patch16_224_fb_in1k) || `deit3_small_patch16_224_fb_in22k_ft_in1k` | [`zeromodels/deit3_small_patch16_224_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_small_patch16_224_fb_in22k_ft_in1k) || `deit3_small_patch16_384_fb_in1k` | [`zeromodels/deit3_small_patch16_384_fb_in1k`](https://huggingface.co/zeromodels/deit3_small_patch16_384_fb_in1k) || `deit3_small_patch16_384_fb_in22k_ft_in1k` | [`zeromodels/deit3_small_patch16_384_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_small_patch16_384_fb_in22k_ft_in1k) || `deit_base_distilled_patch16_224_fb_in1k` | [`zeromodels/deit_base_distilled_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit_base_distilled_patch16_224_fb_in1k) || `deit_base_distilled_patch16_384_fb_in1k` | [`zeromodels/deit_base_distilled_patch16_384_fb_in1k`](https://huggingface.co/zeromodels/deit_base_distilled_patch16_384_fb_in1k) || `deit_base_patch16_224_fb_in1k` | [`zeromodels/deit_base_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit_base_patch16_224_fb_in1k) || `deit_base_patch16_384_fb_in1k` | [`zeromodels/deit_base_patch16_384_fb_in1k`](https://huggingface.co/zeromodels/deit_base_patch16_384_fb_in1k) || `deit_small_distilled_patch16_224_fb_in1k` | [`zeromodels/deit_small_distilled_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit_small_distilled_patch16_224_fb_in1k) || `deit_small_patch16_224_fb_in1k` | [`zeromodels/deit_small_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit_small_patch16_224_fb_in1k) || `deit_tiny_distilled_patch16_224_fb_in1k` | [`zeromodels/deit_tiny_distilled_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit_tiny_distilled_patch16_224_fb_in1k) || `deit_tiny_patch16_224_fb_in1k` | [`zeromodels/deit_tiny_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit_tiny_patch16_224_fb_in1k) |## Tips- Set `KERAS_BACKEND` **before** importing Keras / zeromodels.- `DeiTImageClassify` returns class logits; `DeiTModel` returns features (`as_backbone=True` for multi-scale stages).- See [docs](https://imvision12.github.io/ZeroModels/classification_backbones/) and [Loading Weights](https://imvision12.github.io/ZeroModels/loading_weights/).- Upstream / timm checkpoints: `DeiTImageClassify.from_weights("hf:timm/deit_base_patch16_224.fb_in1k")`.## Special ThanksA huge thank you to the DeiT authors and the timm / Hub communities for creating and releasing these models.License: see YAML `license` (usually matches the upstream checkpoint).123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899---pipeline_tag: image-classificationlicense: apache-2.0base_model: timm/deit_base_patch16_224.fb_in1klibrary_name: zeromodelstags:- keras- zeromodels- image-classification- deit- backbone- arxiv:2012.12877- pytorch- jax- tf---## ***See [our collection](https://huggingface.co/collections/zeromodels/deit-and-deit3-6a8eaefd844d1822f01d81b2) for all versions of DeiT.***# Run DeiT with Keras 3: JAX, PyTorch, or TensorFlow[](https://github.com/IMvision12/ZeroModels) [](https://imvision12.github.io/ZeroModels/classification_backbones/) [](https://huggingface.co/collections/zeromodels/deit-and-deit3-6a8eaefd844d1822f01d81b2)# zeromodels/deit_base_patch16_224_fb_in1kPaper: [Training data-efficient image transformers and distillation through attention (arXiv:2012.12877)](https://arxiv.org/abs/2012.12877) · [HF Papers](https://huggingface.co/papers/2012.12877)DeiT / DeiT3 are data-efficient ViT variants (distillation token in DeiT; improved training recipe in DeiT3). Same ImageClassify / Model API.For more details on the model, please go to the upstream [model card](https://huggingface.co/timm/deit_base_patch16_224.fb_in1k).Pure-**Keras 3** conversion of [`timm/deit_base_patch16_224.fb_in1k`](https://huggingface.co/timm/deit_base_patch16_224.fb_in1k) for [zeromodels](https://github.com/IMvision12/ZeroModels). One implementation runs unmodified on **TensorFlow / Torch / JAX**.This is an **image-classification / backbone** checkpoint (`DeiTImageClassify` / `DeiTModel`).## ✨ Quick start```pythonimport osos.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"from PIL import Imagefrom zeromodels.models.deit import DeiTImageClassify, DeiTModel, DeiTImageProcessormodel = DeiTImageClassify.from_weights("zeromodels/deit_base_patch16_224_fb_in1k")processor = DeiTImageProcessor.from_weights("zeromodels/deit_base_patch16_224_fb_in1k")image = Image.open("your_image.jpg").convert("RGB")pixels = processor(image) # resize + normalize (normalization lives in the processor)logits = model(pixels, training=False)print(logits.shape) # (1, num_classes)# Feature extraction: the backbone without the classifier headbackbone = DeiTModel.from_weights("zeromodels/deit_base_patch16_224_fb_in1k", as_backbone=True)features = backbone(pixels, training=False)```Load any DeiT variant the same way with `from_weights("zeromodels/<variant>")`:| Variant | Hub ||---|---|| `deit3_base_patch16_224_fb_in1k` | [`zeromodels/deit3_base_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit3_base_patch16_224_fb_in1k) || `deit3_base_patch16_224_fb_in22k_ft_in1k` | [`zeromodels/deit3_base_patch16_224_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_base_patch16_224_fb_in22k_ft_in1k) || `deit3_base_patch16_384_fb_in1k` | [`zeromodels/deit3_base_patch16_384_fb_in1k`](https://huggingface.co/zeromodels/deit3_base_patch16_384_fb_in1k) || `deit3_base_patch16_384_fb_in22k_ft_in1k` | [`zeromodels/deit3_base_patch16_384_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_base_patch16_384_fb_in22k_ft_in1k) || `deit3_huge_patch14_224_fb_in1k` | [`zeromodels/deit3_huge_patch14_224_fb_in1k`](https://huggingface.co/zeromodels/deit3_huge_patch14_224_fb_in1k) || `deit3_huge_patch14_224_fb_in22k_ft_in1k` | [`zeromodels/deit3_huge_patch14_224_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_huge_patch14_224_fb_in22k_ft_in1k) || `deit3_large_patch16_224_fb_in1k` | [`zeromodels/deit3_large_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit3_large_patch16_224_fb_in1k) || `deit3_large_patch16_224_fb_in22k_ft_in1k` | [`zeromodels/deit3_large_patch16_224_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_large_patch16_224_fb_in22k_ft_in1k) || `deit3_large_patch16_384_fb_in1k` | [`zeromodels/deit3_large_patch16_384_fb_in1k`](https://huggingface.co/zeromodels/deit3_large_patch16_384_fb_in1k) || `deit3_large_patch16_384_fb_in22k_ft_in1k` | [`zeromodels/deit3_large_patch16_384_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_large_patch16_384_fb_in22k_ft_in1k) || `deit3_medium_patch16_224_fb_in1k` | [`zeromodels/deit3_medium_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit3_medium_patch16_224_fb_in1k) || `deit3_medium_patch16_224_fb_in22k_ft_in1k` | [`zeromodels/deit3_medium_patch16_224_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_medium_patch16_224_fb_in22k_ft_in1k) || `deit3_small_patch16_224_fb_in1k` | [`zeromodels/deit3_small_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit3_small_patch16_224_fb_in1k) || `deit3_small_patch16_224_fb_in22k_ft_in1k` | [`zeromodels/deit3_small_patch16_224_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_small_patch16_224_fb_in22k_ft_in1k) || `deit3_small_patch16_384_fb_in1k` | [`zeromodels/deit3_small_patch16_384_fb_in1k`](https://huggingface.co/zeromodels/deit3_small_patch16_384_fb_in1k) || `deit3_small_patch16_384_fb_in22k_ft_in1k` | [`zeromodels/deit3_small_patch16_384_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/deit3_small_patch16_384_fb_in22k_ft_in1k) || `deit_base_distilled_patch16_224_fb_in1k` | [`zeromodels/deit_base_distilled_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit_base_distilled_patch16_224_fb_in1k) || `deit_base_distilled_patch16_384_fb_in1k` | [`zeromodels/deit_base_distilled_patch16_384_fb_in1k`](https://huggingface.co/zeromodels/deit_base_distilled_patch16_384_fb_in1k) || `deit_base_patch16_224_fb_in1k` | [`zeromodels/deit_base_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit_base_patch16_224_fb_in1k) || `deit_base_patch16_384_fb_in1k` | [`zeromodels/deit_base_patch16_384_fb_in1k`](https://huggingface.co/zeromodels/deit_base_patch16_384_fb_in1k) || `deit_small_distilled_patch16_224_fb_in1k` | [`zeromodels/deit_small_distilled_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit_small_distilled_patch16_224_fb_in1k) || `deit_small_patch16_224_fb_in1k` | [`zeromodels/deit_small_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit_small_patch16_224_fb_in1k) || `deit_tiny_distilled_patch16_224_fb_in1k` | [`zeromodels/deit_tiny_distilled_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit_tiny_distilled_patch16_224_fb_in1k) || `deit_tiny_patch16_224_fb_in1k` | [`zeromodels/deit_tiny_patch16_224_fb_in1k`](https://huggingface.co/zeromodels/deit_tiny_patch16_224_fb_in1k) |## Tips- Set `KERAS_BACKEND` **before** importing Keras / zeromodels.- `DeiTImageClassify` returns class logits; `DeiTModel` returns features (`as_backbone=True` for multi-scale stages).- See [docs](https://imvision12.github.io/ZeroModels/classification_backbones/) and [Loading Weights](https://imvision12.github.io/ZeroModels/loading_weights/).- Upstream / timm checkpoints: `DeiTImageClassify.from_weights("hf:timm/deit_base_patch16_224.fb_in1k")`.## Special ThanksA huge thank you to the DeiT authors and the timm / Hub communities for creating and releasing these models.License: see YAML `license` (usually matches the upstream checkpoint).
README.md+99-99