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

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

# open-clip-torch

Connects images with text descriptions enabling search by words and automatic content filtering systems.

**Details**

- Model name: `open-clip-torch`
- Model source: [https://github.com/mlfoundations/open_clip](https://github.com/mlfoundations/open_clip)
- Model author: Gabriel Ilharco, et al.
- Model license: MIT
- Exposes embeddings? yes
- Tags: `text-embeddings, classification, logits, embeddings, torch, clip, zero-shot, transformer`

**Requirements**

- Packages: `torch, torchvision, open_clip_torch`
- 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("open-clip-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(
    "open-clip-torch",
    text_prompt="A photo of a",
    classes=["person", "dog", "cat", "bird", "car", "tree", "chair"],
)

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