Downloads · 30 days
9
9% of all-time downloads
AliFadel/blip-cxr-mimic-finetuned
blip-cxr-mimic-finetuned is a image-to-text model from AliFadel. Use it when you need a caption or text from an image. It is set up for transformers. The card lists the license as apache-2.0.
A fine-tuned version of Salesforce/blip-image-captioning-base on the MIMIC-CXR dataset for automatic chest X-ray report generation.
Downloads · 30 days
9
9% of all-time downloads
All-time downloads
103
Public
Parameters
224M
896 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors896 MB · 100%
From the Hugging Face model README
A fine-tuned version of Salesforce/blip-image-captioning-base
on the MIMIC-CXR dataset for automatic chest X-ray report generation.
itsanmolgupta/mimic-cxr-datasetfrom transformers import AutoProcessor, AutoModelForImageTextToText
from PIL import Image
import torch
repo_id = "AliFadel/blip-cxr-mimic-finetuned"
processor = AutoProcessor.from_pretrained(repo_id)
model = AutoModelForImageTextToText.from_pretrained(repo_id)
model.eval()
image = Image.open("chest_xray.jpg").convert("RGB")
inputs = processor(images=image, text="Chest X-Ray", return_tensors="pt")
with torch.no_grad():
ids = model.generate(
**inputs,
num_beams=5,
max_length=150,
repetition_penalty=1.5,
top_p=0.95,
)
caption = processor.batch_decode(ids, skip_special_tokens=True)[0]
print(caption)
This model is intended for research purposes only. It should not be used as a clinical diagnostic tool without expert medical supervision.