-
Notifications
You must be signed in to change notification settings - Fork 656
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
Grounding DINO is now available in 🤗 Transformers! #321
Comments
Relevant for #88 |
Thanks for your work! The results you report are My results based on the transformer package import matplotlib.pyplot as plt image = Image.open('000000039769.jpg') text = "cat" target_sizes = torch.tensor([image.size[::-1]]) for score, label, box in zip(results["scores"], results["labels"], results["boxes"]): Results: The results based on the official code and colab. import os CONFIG_PATH = os.path.join(HOME, "GroundingDINO/groundingdino/config/GroundingDINO_SwinT_OGC.py") from groundingdino.util.inference import load_model, load_image, predict, annotate model = load_model(CONFIG_PATH, WEIGHTS_PATH) IMAGE_NAME = "000000039769.jpg" TEXT_PROMPT = "cat" image_source, image = load_image(IMAGE_PATH) boxes, logits, phrases = predict( annotated_frame = annotate(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases) %matplotlib inline |
Pinging @EduardoPach here |
Actually, the output is the same :D, there's only one catch in your example. The original implementation takes your text prompt and adds a |
it's possible to train? |
Think you! |
In theory, you can, it wasn't extensively tested, but if you find any problems open an issue in the transformers repo and tag me there |
Hi folks!
Grounding DINO is now available in the Transformers library, enabling easy inference in a few lines of code.
Here's how to use it:
Demo notebook: https://github.com/NielsRogge/Transformers-Tutorials/blob/master/Grounding%20DINO/Inference_with_Grounding_DINO_for_zero_shot_object_detection.ipynb
Checkpoints are on the hub: https://huggingface.co/models?other=grounding-dino
The text was updated successfully, but these errors were encountered: