Run this model with HF Jobs

Run WafaaFraih/blip-roco-radiology-captioning 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:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/WafaaFraih/blip-roco-radiology-captioning. 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.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/WafaaFraih/blip-roco-radiology-captioning 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.

BLIP Fine-tuned for Radiology Image Captioning

This model is a fine-tuned version of BLIP on the ROCOv2 radiology dataset for generating captions of medical radiology images.

Usage

from transformers import BlipForConditionalGeneration, AutoProcessor
from PIL import Image

# Load model and processor
processor = AutoProcessor.from_pretrained("WafaaFraih/blip-roco-radiology-captioning")
model = BlipForConditionalGeneration.from_pretrained("WafaaFraih/blip-roco-radiology-captioning")

# Process image
image = Image.open("radiology_image.jpg")
inputs = processor(images=image, return_tensors="pt")

# Generate caption
generated_ids = model.generate(
    pixel_values=inputs["pixel_values"],
    max_new_tokens=64,
    num_beams=5,
    length_penalty=0.8
)

caption = processor.batch_decode(generated_ids, skip_special_tokens=True)[0].strip()
print(caption)

Model Details

  • Base Model: Salesforce/blip-image-captioning-base
  • Dataset: ROCOv2 Radiology
  • Task: Medical image captioning
  • Fine-tuning: Full precision (FP32)
Downloads last month
100
Safetensors
Model size
0.2B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train WafaaFraih/blip-roco-radiology-captioning

Spaces using WafaaFraih/blip-roco-radiology-captioning 2