-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Description
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?
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
Metadata
Metadata
Assignees
Labels
No labels