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

[GroundingDino] - GroundingDinoProcessor kwargs is Broken #31952

Closed
4 tasks
EduardoPach opened this issue Jul 14, 2024 · 3 comments
Closed
4 tasks

[GroundingDino] - GroundingDinoProcessor kwargs is Broken #31952

EduardoPach opened this issue Jul 14, 2024 · 3 comments

Comments

@EduardoPach
Copy link
Contributor

System Info

While working on #31828 I realized that GroundingDinoProcessor.__call__ passes the kwargs only to the self.tokenizer which is not ideal specially if one wants to pass annotations to self.image_processor as it's currently not possible.

It should be an easy fix following #31197

Who can help?

@amyeroberts

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

from transformers import AutoProcessor
from datasets import load_dataset

processor = AutoPocessor.from_pretrained("IDEA-Research/grounding-dino-tiny")
ds = load_dataset("EduardoPacheco/aquarium-sample", split="train")
id2label = {0: "fish", 1: "jellyfish", 2: "penguins", 3: "sharks", 4: "puffins", 5: "stingrays", 6: "starfish"}
prompt = ". ".join(id2label.values()) + "."

# Passes `annotations` as kwargs to tokenizer instead of image_processor
inputs = processor(images=ds["image"], text=[prompt, prompt], annotations=ds["annotations"], return_tensors="pt")

Expected behavior

Kwargs being correctly mapped to tokenizer and image processor

@NielsRogge
Copy link
Contributor

We're tracking them all at #31911, cc @zucchini-nlp I guess we can add Grounding DINO to that list

@zucchini-nlp
Copy link
Member

Sure, added to the list. Guess we can close this issue now and track Grounding DINO in 31911 :)

Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

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

3 participants