Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make the description longer and more detailed? #228

Open
CaledoniaProject opened this issue Jan 31, 2025 · 0 comments
Open

How to make the description longer and more detailed? #228

CaledoniaProject opened this issue Jan 31, 2025 · 0 comments

Comments

@CaledoniaProject
Copy link

I have a small script that captions the image

import argparse
import glob
import os
from PIL import Image, UnidentifiedImageError
from transformers import pipeline

captioner = pipeline("image-to-text", "Salesforce/blip-image-captioning-large")
captionText = captioner(jpegFile, max_new_tokens=100)[0]["generated_text"]

However, the generated text is like 20 tokens, never reached 100 tokens. The description of the image is not "precise" enough, many details are missed.

e.g this picture generates araffe walking down the sidewalk in a city with a backpack

Image

Many details like the backpack color, the background scene are missing, even with the large model. How can I ask blip to be more detailed?

@CaledoniaProject CaledoniaProject changed the title Make it longer Make the description longer Jan 31, 2025
@CaledoniaProject CaledoniaProject changed the title Make the description longer How to make the description longer and more detailed? Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant