Instructions to use NikkiZed/openclip-vit-g-14 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- OpenCLIP
How to use NikkiZed/openclip-vit-g-14 with OpenCLIP:
import open_clip model, preprocess_train, preprocess_val = open_clip.create_model_and_transforms('hf-hub:NikkiZed/openclip-vit-g-14') tokenizer = open_clip.get_tokenizer('hf-hub:NikkiZed/openclip-vit-g-14') - Notebooks
- Google Colab
- Kaggle
OpenCLIP ViT-g-14 Model
This is an OpenCLIP model using the ViT-g-14 architecture, pretrained on the LAION-2B dataset.
Usage
Run inference locally using the following example:
import open_clip
from PIL import Image
import torch
# Load the model and preprocessing pipeline
model, preprocess = open_clip.create_model_and_transforms(
"hf-hub:NikkiZed/openclip-vit-g-14",
pretrained="open_clip_pytorch_model.bin"
)
# Load and preprocess an image
image = Image.open("path_to_image.jpg").convert("RGB")
input_tensor = preprocess(image).unsqueeze(0)
# Generate embeddings
with torch.no_grad():
features = model.encode_image(input_tensor)
print("Image features:", features)
- Downloads last month
- 2
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support