How to make the description longer and more detailed?

#40
by oddball516 - opened

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?

Sign up or log in to comment