Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
Arabic-Clip/araclip · Hugging Face
[go: Go Back, main page]

This model has been pushed to the Hub using the PytorchModelHubMixin integration:

How to use

pip install git+https://github.com/Arabic-Clip/Araclip.git
# load model
import numpy as np
from PIL import Image
from araclip import AraClip
model = AraClip.from_pretrained("Arabic-Clip/araclip")

# data
labels = ["قطة جالسة", "قطة تقفز" ,"كلب", "حصان"]
image = Image.open("cat.png")

# embed data 
image_features = model.embed(image=image)
text_features = np.stack([model.embed(text=label) for label in labels])

# search for most similar data
similarities = text_features @ image_features
best_match = labels[np.argmax(similarities)]

print(f"The image is most similar to: {best_match}")
# قطة جالسة

image/png

Downloads last month
10
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Spaces using Arabic-Clip/araclip 2