File size: 1,298 Bytes
a6d3f56 7653391 f923d77 a6d3f56 f923d77 a6d3f56 b646d4f 1804878 c758137 1804878 c758137 b646d4f 7653391 a6d3f56 7653391 a6d3f56 7653391 a6d3f56 7653391 a6d3f56 f923d77 7653391 a6d3f56 f923d77 a6d3f56 7653391 a6d3f56 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
---
tags:
- vision
library_name: transformers
---
## Model Details
### The CLIP model was pretrained from openai/clip-vit-base-patch32 , to learn about what contributes to robustness in computer vision tasks.
### The model has the ability to generalize to arbitrary image classification tasks in a zero-shot manner.
Top predictions:
Saree: 64.89%
Dupatta: 25.81%
Lehenga: 7.51%
Leggings and Salwar: 0.84%
Women Kurta: 0.44%
![image/png](https://cdn-uploads.huggingface.co/production/uploads/660bc03b5294ca0aada80fb9/Kl8Yd8fwFLtmeDbBLi4Fz.png)
### Use with Transformers
```python3
from PIL import Image
import requests
from transformers import CLIPProcessor, CLIPModel
model = CLIPModel.from_pretrained("samim2024/clip")
processor = CLIPProcessor.from_pretrained("samim2024/clip")
url = "https://www.istockphoto.com/photo/indian-saris-gm93355119-10451468"
image = Image.open(requests.get(url, stream=True).raw)
inputs = processor(text=["a photo of a saree", "a photo of a blouse"], images=image, return_tensors="pt", padding=True)
outputs = model(**inputs)
logits_per_image = outputs.logits_per_image # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1) # we can take the softmax to get the label probabilities
```
|