We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
hello, thanks for your excellent work! I found the huggingface demo of Grounding-DINO is not work. The output results are as follows:
import requests import torch from PIL import Image from transformers import AutoProcessor, AutoModelForZeroShotObjectDetection model_id = "IDEA-Research/grounding-dino-tiny" device = "cuda" processor = AutoProcessor.from_pretrained(model_id) model = AutoModelForZeroShotObjectDetection.from_pretrained(model_id).to(device) image_url = "http://images.cocodataset.org/val2017/000000039769.jpg" image = Image.open(requests.get(image_url, stream=True).raw) # Check for cats and remote controls text = "a cat. a remote control." inputs = processor(images=image, text=text, return_tensors="pt").to(device) with torch.no_grad(): outputs = model(**inputs) results = processor.post_process_grounded_object_detection( outputs, inputs.input_ids, box_threshold=0.4, text_threshold=0.3, target_sizes=[image.size[::-1]] ) print(results)
[{'scores': tensor([], device='cuda:0'), 'labels': [], 'boxes': tensor([], device='cuda:0', size=(0, 4))}]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
hello, thanks for your excellent work! I found the huggingface demo of Grounding-DINO is not work. The output results are as follows:
The text was updated successfully, but these errors were encountered: