google / vit-hybrid-base-bit-384

huggingface.co
Total runs: 7.4K
24-hour runs: 0
7-day runs: 1.6K
30-day runs: 4.4K
Model's Last Updated: September 12 2023
image-classification

Introduction of vit-hybrid-base-bit-384

Model Details of vit-hybrid-base-bit-384

Vision Transformer (base-sized model) - Hybrid

The hybrid Vision Transformer (ViT) model was proposed in An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale by Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, Neil Houlsby. It's the first paper that successfully trains a Transformer encoder on ImageNet, attaining very good results compared to familiar convolutional architectures. ViT hybrid is a slight variant of the plain Vision Transformer , by leveraging a convolutional backbone (specifically, BiT ) whose features are used as initial "tokens" for the Transformer.

Disclaimer: The team releasing ViT did not write a model card for this model so this model card has been written by the Hugging Face team.

Model description

While the Transformer architecture has become the de-facto standard for natural language processing tasks, its applications to computer vision remain limited. In vision, attention is either applied in conjunction with convolutional networks, or used to replace certain components of convolutional networks while keeping their overall structure in place. We show that this reliance on CNNs is not necessary and a pure transformer applied directly to sequences of image patches can perform very well on image classification tasks. When pre-trained on large amounts of data and transferred to multiple mid-sized or small image recognition benchmarks (ImageNet, CIFAR-100, VTAB, etc.), Vision Transformer (ViT) attains excellent results compared to state-of-the-art convolutional networks while requiring substantially fewer computational resources to train.

Intended uses & limitations

You can use the raw model for image classification. See the model hub to look for fine-tuned versions on a task that interests you.

How to use

Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:

from transformers import ViTHybridImageProcessor, ViTHybridForImageClassification
from PIL import Image
import requests

url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
image = Image.open(requests.get(url, stream=True).raw)

feature_extractor = ViTHybridImageProcessor.from_pretrained('google/vit-hybrid-base-bit-384')
model = ViTHybridForImageClassification.from_pretrained('google/vit-hybrid-base-bit-384')

inputs = feature_extractor(images=image, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
# model predicts one of the 1000 ImageNet classes
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])
>>> tabby, tabby cat

For more code examples, we refer to the documentation .

Training data

The ViT-Hybrid model was pretrained on ImageNet-21k , a dataset consisting of 14 million images and 21k classes, and fine-tuned on ImageNet , a dataset consisting of 1 million images and 1k classes.

Training procedure
Preprocessing

The exact details of preprocessing of images during training/validation can be found here .

Images are resized/rescaled to the same resolution (224x224) and normalized across the RGB channels with mean (0.5, 0.5, 0.5) and standard deviation (0.5, 0.5, 0.5).

Pretraining

The model was trained on TPUv3 hardware (8 cores). All model variants are trained with a batch size of 4096 and learning rate warmup of 10k steps. For ImageNet, the authors found it beneficial to additionally apply gradient clipping at global norm 1. Training resolution is 224.

Evaluation results

For evaluation results on several image classification benchmarks, we refer to tables 2 and 5 of the original paper. Note that for fine-tuning, the best results are obtained with a higher resolution (384x384). Of course, increasing the model size will result in better performance.

BibTeX entry and citation info
@misc{wu2020visual,
      title={Visual Transformers: Token-based Image Representation and Processing for Computer Vision}, 
      author={Bichen Wu and Chenfeng Xu and Xiaoliang Dai and Alvin Wan and Peizhao Zhang and Zhicheng Yan and Masayoshi Tomizuka and Joseph Gonzalez and Kurt Keutzer and Peter Vajda},
      year={2020},
      eprint={2006.03677},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
@inproceedings{deng2009imagenet,
  title={Imagenet: A large-scale hierarchical image database},
  author={Deng, Jia and Dong, Wei and Socher, Richard and Li, Li-Jia and Li, Kai and Fei-Fei, Li},
  booktitle={2009 IEEE conference on computer vision and pattern recognition},
  pages={248--255},
  year={2009},
  organization={Ieee}
}

Runs of google vit-hybrid-base-bit-384 on huggingface.co

7.4K
Total runs
0
24-hour runs
696
3-day runs
1.6K
7-day runs
4.4K
30-day runs

More Information About vit-hybrid-base-bit-384 huggingface.co Model

More vit-hybrid-base-bit-384 license Visit here:

https://choosealicense.com/licenses/apache-2.0

vit-hybrid-base-bit-384 huggingface.co

vit-hybrid-base-bit-384 huggingface.co is an AI model on huggingface.co that provides vit-hybrid-base-bit-384's model effect (), which can be used instantly with this google vit-hybrid-base-bit-384 model. huggingface.co supports a free trial of the vit-hybrid-base-bit-384 model, and also provides paid use of the vit-hybrid-base-bit-384. Support call vit-hybrid-base-bit-384 model through api, including Node.js, Python, http.

vit-hybrid-base-bit-384 huggingface.co Url

https://huggingface.co/google/vit-hybrid-base-bit-384

google vit-hybrid-base-bit-384 online free

vit-hybrid-base-bit-384 huggingface.co is an online trial and call api platform, which integrates vit-hybrid-base-bit-384's modeling effects, including api services, and provides a free online trial of vit-hybrid-base-bit-384, you can try vit-hybrid-base-bit-384 online for free by clicking the link below.

google vit-hybrid-base-bit-384 online free url in huggingface.co:

https://huggingface.co/google/vit-hybrid-base-bit-384

vit-hybrid-base-bit-384 install

vit-hybrid-base-bit-384 is an open source model from GitHub that offers a free installation service, and any user can find vit-hybrid-base-bit-384 on GitHub to install. At the same time, huggingface.co provides the effect of vit-hybrid-base-bit-384 install, users can directly use vit-hybrid-base-bit-384 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

vit-hybrid-base-bit-384 install url in huggingface.co:

https://huggingface.co/google/vit-hybrid-base-bit-384

Url of vit-hybrid-base-bit-384

vit-hybrid-base-bit-384 huggingface.co Url

Provider of vit-hybrid-base-bit-384 huggingface.co

google
ORGANIZATIONS

Other API from google

huggingface.co

Total runs: 2.2M
Run Growth: -11.4M
Growth Rate: -527.13%
Updated: August 08 2024
huggingface.co

Total runs: 2.1M
Run Growth: -159.2K
Growth Rate: -7.43%
Updated: January 25 2023
huggingface.co

Total runs: 1.7M
Run Growth: -1.7M
Growth Rate: -97.41%
Updated: February 29 2024
huggingface.co

Total runs: 1.5M
Run Growth: -78.3K
Growth Rate: -5.39%
Updated: April 29 2024
huggingface.co

Total runs: 1.4M
Run Growth: 539.6K
Growth Rate: 38.86%
Updated: January 25 2023
huggingface.co

Total runs: 1.3M
Run Growth: 241.2K
Growth Rate: 18.23%
Updated: July 17 2023
huggingface.co

Total runs: 750.1K
Run Growth: 112.0K
Growth Rate: 14.93%
Updated: August 28 2024
huggingface.co

Total runs: 641.9K
Run Growth: 117.7K
Growth Rate: 18.33%
Updated: July 17 2023
huggingface.co

Total runs: 635.2K
Run Growth: 82.3K
Growth Rate: 12.96%
Updated: July 27 2023
huggingface.co

Total runs: 623.4K
Run Growth: 411.5K
Growth Rate: 66.01%
Updated: August 14 2024
huggingface.co

Total runs: 600.3K
Run Growth: 585.1K
Growth Rate: 97.46%
Updated: August 08 2024
huggingface.co

Total runs: 507.3K
Run Growth: 192.7K
Growth Rate: 37.99%
Updated: October 11 2023
huggingface.co

Total runs: 396.4K
Run Growth: -124.5K
Growth Rate: -31.40%
Updated: September 27 2024
huggingface.co

Total runs: 317.0K
Run Growth: -125.8K
Growth Rate: -39.69%
Updated: August 28 2024
huggingface.co

Total runs: 288.0K
Run Growth: 286.9K
Growth Rate: 99.63%
Updated: August 03 2023
huggingface.co

Total runs: 233.6K
Run Growth: 110.5K
Growth Rate: 47.33%
Updated: January 25 2023
huggingface.co

Total runs: 215.0K
Run Growth: -25.7K
Growth Rate: -11.95%
Updated: August 28 2024
huggingface.co

Total runs: 213.3K
Run Growth: -395.1K
Growth Rate: -185.19%
Updated: January 25 2023
huggingface.co

Total runs: 208.4K
Run Growth: 66.4K
Growth Rate: 31.85%
Updated: November 07 2023
huggingface.co

Total runs: 192.1K
Run Growth: 54.9K
Growth Rate: 28.57%
Updated: November 28 2023
huggingface.co

Total runs: 153.1K
Run Growth: -4.5K
Growth Rate: -2.94%
Updated: January 25 2023
huggingface.co

Total runs: 146.1K
Run Growth: -46.2K
Growth Rate: -31.63%
Updated: September 07 2023
huggingface.co

Total runs: 129.8K
Run Growth: -206.2K
Growth Rate: -158.89%
Updated: June 27 2024
huggingface.co

Total runs: 121.3K
Run Growth: -5.4K
Growth Rate: -4.44%
Updated: September 18 2023
huggingface.co

Total runs: 111.2K
Run Growth: 26.3K
Growth Rate: 23.62%
Updated: January 25 2023
huggingface.co

Total runs: 101.7K
Run Growth: -215.2K
Growth Rate: -211.67%
Updated: January 25 2023
huggingface.co

Total runs: 98.8K
Run Growth: 22.3K
Growth Rate: 22.57%
Updated: January 25 2023
huggingface.co

Total runs: 93.5K
Run Growth: 1.2K
Growth Rate: 1.26%
Updated: September 27 2024
huggingface.co

Total runs: 76.3K
Run Growth: -89.4K
Growth Rate: -117.09%
Updated: August 08 2024
huggingface.co

Total runs: 64.1K
Run Growth: 6.0K
Growth Rate: 9.28%
Updated: January 25 2023
huggingface.co

Total runs: 62.5K
Run Growth: 11.9K
Growth Rate: 19.10%
Updated: January 25 2023
huggingface.co

Total runs: 44.3K
Run Growth: 26.3K
Growth Rate: 59.25%
Updated: January 25 2023
huggingface.co

Total runs: 43.2K
Run Growth: 41.4K
Growth Rate: 95.95%
Updated: November 29 2021
huggingface.co

Total runs: 26.1K
Run Growth: -12.6K
Growth Rate: -48.26%
Updated: November 27 2023
huggingface.co

Total runs: 23.2K
Run Growth: 620
Growth Rate: 2.68%
Updated: January 25 2023
huggingface.co

Total runs: 11.6K
Run Growth: 1.8K
Growth Rate: 17.34%
Updated: July 06 2023
huggingface.co

Total runs: 9.9K
Run Growth: 3.1K
Growth Rate: 30.72%
Updated: April 29 2024
huggingface.co

Total runs: 8.9K
Run Growth: -31.2K
Growth Rate: -351.34%
Updated: September 07 2023
huggingface.co

Total runs: 7.8K
Run Growth: -4.0K
Growth Rate: -51.52%
Updated: January 25 2023