1aurent/PatchCamelyon
Viewer โข Updated โข 328k โข 4.54k โข 13
Run lens-ai/clip-vit-base-patch32_pcam_finetuned on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/lens-ai/clip-vit-base-patch32_pcam_finetuned. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/lens-ai/clip-vit-base-patch32_pcam_finetuned on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use lens-ai/clip-vit-base-patch32_pcam_finetuned with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("feature-extraction", model="lens-ai/clip-vit-base-patch32_pcam_finetuned") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("lens-ai/clip-vit-base-patch32_pcam_finetuned")
model = AutoModel.from_pretrained("lens-ai/clip-vit-base-patch32_pcam_finetuned", device_map="auto")This repository contains a fine-tuned version of the CLIP ViT Base Patch32 model on the PatchCamelyon (PCAM) dataset. The model is optimized for histopathological image classification.
openai/clip-vit-base-patch32PatchCamelyonEnsure you have transformers, torch, and safetensors installed:
pip install transformers torch safetensors
from transformers import CLIPProcessor, CLIPModel
import torch
model_path = "lens-ai/clip-vit-base-patch32_pcam_finetuned"
model = CLIPModel.from_pretrained(model_path)
processor = CLIPProcessor.from_pretrained(model_path)
from PIL import Image
image = Image.open("sample_image.png")
inputs = processor(images=image, return_tensors="pt")
outputs = model.get_image_features(**inputs)
We plan to release additional metrics, including robustness evaluation with adversarial attacks in future updates.
This model is released under the MIT License.
For any questions, please reach out to Venkata Tej at LensAI.