| --- |
| title: "ViT-Tiny" |
| subtitle: "Vision transformer image classifier" |
| category: "Vision AI" |
| model_type: |
| - "Classification" |
| license: apache-2.0 |
| code: "https://huggingface.co/timm/vit_tiny_patch16_224.augreg_in21k" |
| tags: |
| - robotics-ai-suite |
| - vision-ai |
| - "chipset:ptl" |
| thumbnail: assets/thumbnail.png |
| --- |
| |
| ViT-Tiny image classification model, a [Geti™](https://github.com/open-edge-platform/geti) |
| build of [ViT-Tiny](https://huggingface.co/timm/vit_tiny_patch16_224.augreg_in21k) |
| converted to OpenVINO™ IR with FP16 weights. It maps an input image to class |
| scores. Model weights are hosted in the source repository |
| [OpenVINO/vit_tiny_cls-fp16-ov](https://huggingface.co/OpenVINO/vit_tiny_cls-fp16-ov). |
|
|
| # How to Use |
|
|
| 1. Install required packages: |
|
|
| ```sh |
| pip install openvino-model-api[huggingface] |
| ``` |
|
|
| 2. Run model inference: |
|
|
| ```python |
| import cv2 |
| from model_api.models import Model |
| from model_api.visualizer import Visualizer |
| |
| model = Model.from_pretrained("OpenVINO/vit_tiny_cls-fp16-ov") |
| image = cv2.imread("image.jpg") |
| result = model(image) |
| vis = Visualizer().render(image, result) |
| cv2.imwrite("output.jpg", vis) |
| ``` |
|
|
| # Legal information |
|
|
| The original model is distributed under the |
| [Apache-2.0](https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/apache-2.0.md) |
| license. More details can be found in the |
| [original model card](https://huggingface.co/timm/vit_tiny_patch16_224.augreg_in21k). |
|
|