Comments (3)
cc @EduardoPach
from transformers-tutorials.
I'm really excited to see grounding DINO integrated into transformers! I've followed the tutorial link below and tried it on my local machine, but how do I do detection for multiple classes?
I saw in the official documentation to do something like "a cat. a remote controller.", but when I tried it, it didn't detect for cat and remote controller individually, but combined them together.
Am I missing something?
TL;DR if you're using the pipeline pass the labels as a list of text (a tip is to add the .
at the end as it is expected by the model) and if you're using the model+processor combo use the all in one text way
Hey! So if you're using the ZeroShotObjectDetectionPipeline
you have to provide the labels through the candidate_labels
argument which is expected to be a list of strings then you should use ["a cat.", "a remote control."]
If you're using GroundingDinoForObjectDetection
with GroundingDInoProcessor
then yeah the way to go is with "a cat. a remote control."
.
You may ask, why this weird difference?
and the answer is:
ZeroShotObjectDetectionPipeline
is older thanGroundingDino
and was probably designed to work with the zero shot models that came first.ZeroShotObjectDetectionPipeline
loop through thecandidate_labels
when doing the inference and post process with the image processorpost_process_object_detection
and the only reason whyGroundingDino
is compatible is because of the loop since thepost_process_object_detection
fromGroundingDinoImageProcessor
doesn't return the actual text label.- If you want to pass all the possible labels in one text and get the text labels you need to use
GroundingDinoProcessor
post_process_grounded_object_detection
and format your text as"label1. label2. label3. ...."
asGroundingDino
work with sub-sentence level text input.
from transformers-tutorials.
@EduardoPach Thanks! I'll try them asap
from transformers-tutorials.
Related Issues (20)
- How can we Fine Tune Pix2StruCt for DocVQA task?
- UDOP - Is it possible to get several bboxes from one single input ?
- [Bug] Owlv2 Zero-shot object detection
- True Inference with Layoutlmv3 HOT 2
- Huge negative loss while fine-tuning SAM HOT 2
- Fine tune TrOCR on IAM Handwriting Database using Seq2SeqTrainer HOT 13
- [Finetuning OneFormer] How to use multiple GPUs
- can't login to push hub model
- Mask2Former panoptic fine-tune HOT 3
- SAM Instance segmentation Finetuning output mask with instance lablel
- Table transformer demo not handling empty cells
- "Unused or unrecognized kwargs: padding" error when running notebook example
- UDOP - Fine tuning with bad metrics HOT 2
- Adding Inference Pipeline for Table-Transformer HOT 1
- - [x] https://github.com/NielsRogge/Transformers-Tutorials/issues/421#issue-2287902399
- TrOCR small for license plate
- Fine-tuning BERT
- DETA Swin Large: Input image size (800*800) doesn't match model (224*224).
- Fine Tuning CodeT5p-770m model for text-to-code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transformers-tutorials.