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

Bug in predict() method [incorrect prompt] #4

Open
danigarciaoca opened this issue Sep 27, 2024 · 0 comments
Open

Bug in predict() method [incorrect prompt] #4

danigarciaoca opened this issue Sep 27, 2024 · 0 comments

Comments

@danigarciaoca
Copy link

danigarciaoca commented Sep 27, 2024

Hi!

First of all, thanks a lot for this huge contribution.

I've been testing Florence-2 recently and believe I've found a significant bug, specifically in the predict() method:

ontology_classes = self.ontology.classes()  <--
result = run_example(
    "<CAPTION_TO_PHRASE_GROUNDING>",
    self.processor,
    self.model,
    image,
    "A photo of " + ", and ".join(ontology_classes) + ".",  <--
)

As it can be seen, when inferencing, the prompt is being composed from the ontology classes instead of from the actual prompts.

Btw, I've also noticed a huge improvement when removing the prefix "A photo of" and just leaving the prompts:

", ".join(ontology_classes) + ".",

Hope it's helpful!

KR,

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