<!-- # hard line break macro for HTML -->

<a id="model-zoo-clip-vit-base32-torch"></a>

# clip-vit-base32-torch

Understands both images and text together, enabling search and classification using natural language descriptions.

**Details**

- Model name: `clip-vit-base32-torch`
- Model source: [https://github.com/openai/CLIP](https://github.com/openai/CLIP)
- Model author: Alec Radford, et al.
- Model license: MIT
- Model size: 337.58 MB
- Exposes embeddings? yes
- Tags: `text-embeddings, classification, logits, embeddings, torch, clip, zero-shot, transformer, official`

**Requirements**

- Packages: `torch, torchvision`
- CPU support
  - yes
- GPU support
  - yes

**Example usage**

```python
import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset(
    "coco-2017",
    split="validation",
    dataset_name=fo.get_default_dataset_name(),
    max_samples=50,
    shuffle=True,
)

model = foz.load_zoo_model("clip-vit-base32-torch")

dataset.apply_model(model, label_field="predictions")

session = fo.launch_app(dataset)

#
# Make zero-shot predictions with custom classes
#

model = foz.load_zoo_model(
    "clip-vit-base32-torch",
    text_prompt="A photo of a",
    classes=["person", "dog", "cat", "bird", "car", "tree", "chair"],
)

dataset.apply_model(model, label_field="predictions")
session.refresh()
```
