gokaygokay / Florence-2-SD3-Captioner

huggingface.co
Total runs: 30.8K
24-hour runs: 1.4K
7-day runs: 11.3K
30-day runs: -12.4K
Model's Last Updated: 2024年9月18日
image-text-to-text

Introduction of Florence-2-SD3-Captioner

Model Details of Florence-2-SD3-Captioner

pip install -q datasets flash_attn timm einops
from transformers import AutoModelForCausalLM, AutoProcessor, AutoConfig
import torch

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

model = AutoModelForCausalLM.from_pretrained("gokaygokay/Florence-2-SD3-Captioner", trust_remote_code=True).to(device).eval()
processor = AutoProcessor.from_pretrained("gokaygokay/Florence-2-SD3-Captioner", trust_remote_code=True)

# Function to run the model on an example
def run_example(task_prompt, text_input, image):
    prompt = task_prompt + text_input

    # Ensure the image is in RGB mode
    if image.mode != "RGB":
        image = image.convert("RGB")

    inputs = processor(text=prompt, images=image, return_tensors="pt").to(device)
    generated_ids = model.generate(
        input_ids=inputs["input_ids"],
        pixel_values=inputs["pixel_values"],
        max_new_tokens=1024,
        num_beams=3
    )
    generated_text = processor.batch_decode(generated_ids, skip_special_tokens=False)[0]
    parsed_answer = processor.post_process_generation(generated_text, task=task_prompt, image_size=(image.width, image.height))
    return parsed_answer

from PIL import Image
import requests
import copy

url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg?download=true"
image = Image.open(requests.get(url, stream=True).raw)
run_example("<DESCRIPTION>", "Describe this image in great detail.", image)

# {'<DESCRIPTION>': 'Captured at eye-level on a sunny day, a light blue Volkswagen Beetle is parked on a cobblestone street. The beetle is parked in front of a yellow building with two brown doors. The door on the right side of the frame is white, while the left side is a darker shade of blue. The car is facing the camera, and the car is positioned in the middle of the street.'}

Runs of gokaygokay Florence-2-SD3-Captioner on huggingface.co

30.8K
Total runs
1.4K
24-hour runs
7.9K
3-day runs
11.3K
7-day runs
-12.4K
30-day runs

More Information About Florence-2-SD3-Captioner huggingface.co Model

More Florence-2-SD3-Captioner license Visit here:

https://choosealicense.com/licenses/apache-2.0

Florence-2-SD3-Captioner huggingface.co

Florence-2-SD3-Captioner huggingface.co is an AI model on huggingface.co that provides Florence-2-SD3-Captioner's model effect (), which can be used instantly with this gokaygokay Florence-2-SD3-Captioner model. huggingface.co supports a free trial of the Florence-2-SD3-Captioner model, and also provides paid use of the Florence-2-SD3-Captioner. Support call Florence-2-SD3-Captioner model through api, including Node.js, Python, http.

Florence-2-SD3-Captioner huggingface.co Url

https://huggingface.co/gokaygokay/Florence-2-SD3-Captioner

gokaygokay Florence-2-SD3-Captioner online free

Florence-2-SD3-Captioner huggingface.co is an online trial and call api platform, which integrates Florence-2-SD3-Captioner's modeling effects, including api services, and provides a free online trial of Florence-2-SD3-Captioner, you can try Florence-2-SD3-Captioner online for free by clicking the link below.

gokaygokay Florence-2-SD3-Captioner online free url in huggingface.co:

https://huggingface.co/gokaygokay/Florence-2-SD3-Captioner

Florence-2-SD3-Captioner install

Florence-2-SD3-Captioner is an open source model from GitHub that offers a free installation service, and any user can find Florence-2-SD3-Captioner on GitHub to install. At the same time, huggingface.co provides the effect of Florence-2-SD3-Captioner install, users can directly use Florence-2-SD3-Captioner installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Florence-2-SD3-Captioner install url in huggingface.co:

https://huggingface.co/gokaygokay/Florence-2-SD3-Captioner

Url of Florence-2-SD3-Captioner

Florence-2-SD3-Captioner huggingface.co Url

Provider of Florence-2-SD3-Captioner huggingface.co

gokaygokay
ORGANIZATIONS

Other API from gokaygokay

huggingface.co

Total runs: 97
Run Growth: 0
Growth Rate: 0.00%
Updated: 2025年1月3日
huggingface.co

Total runs: 37
Run Growth: 1
Growth Rate: 12.50%
Updated: 2024年9月27日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated: 2024年10月31日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated: 2024年8月14日