Views
No views yet
openai/clip-vit-base-patch32PatchCamelyontransformers, torch, and safetensors installed:pip install transformers torch safetensors1from transformers import CLIPProcessor, CLIPModel
2import torch
3
4model_path = "lens-ai/clip-vit-base-patch32_pcam_finetuned"
5model = CLIPModel.from_pretrained(model_path)
6processor = CLIPProcessor.from_pretrained(model_path)1from PIL import Image
2
3image = Image.open("sample_image.png")
4inputs = processor(images=image, return_tensors="pt")
5outputs = model.get_image_features(**inputs)