You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

Aim

The model generates captions in Turkish Language for Satellite Images

Usage

# you will need to adjust code if you didnt use peft

from PIL import Image
from transformers import PaliGemmaForConditionalGeneration, PaliGemmaProcessor
import torch
import requests
from peft import PeftModel

base_model_id = BASE_MODEL_ID
peft_model_id = THIS_MODEL_ID
max_new_tokens = 100
text = "caption tr?"
img_url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/bee.JPG?download=true"
image = Image.open(requests.get(img_url, stream=True).raw)

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
base_model = PaliGemmaForConditionalGeneration.from_pretrained(base_model_id)
processor = PaliGemmaProcessor.from_pretrained(base_model_id)

model = PeftModel.from_pretrained(base_model, peft_model_id)
model.merge_and_unload()

model = model.eval().to(device)

inputs = processor(text=text, images=image, return_tensors="pt").to(device)
with torch.inference_mode():
    generated_ids = model.generate(
        **inputs,
        max_new_tokens=max_new_tokens,
        do_sample=False,
    )
result = processor.batch_decode(generated_ids, skip_special_tokens=True)
print(result)
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.

Model tree for uisikdag/paligemma-3b-mix-224-rsicd-tr

Finetuned
(13)
this model

Collection including uisikdag/paligemma-3b-mix-224-rsicd-tr