Instructions to use IDEA-Research/grounding-dino-tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IDEA-Research/grounding-dino-tiny with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-object-detection", model="IDEA-Research/grounding-dino-tiny")# Load model directly from transformers import AutoProcessor, AutoModelForZeroShotObjectDetection processor = AutoProcessor.from_pretrained("IDEA-Research/grounding-dino-tiny") model = AutoModelForZeroShotObjectDetection.from_pretrained("IDEA-Research/grounding-dino-tiny") - Notebooks
- Google Colab
- Kaggle
Code for batch inference?
#1
by tariksetia - opened
frames = [.....List of PIL.Image....]
inputs = processor(images=frames, text=text, return_tensors="pt").to(device)
with torch.no_grad():
outputs = model(**inputs)
print(outputs)
RuntimeError: The size of tensor a (3) must match the size of tensor b (6) at non-singleton dimension 2
@tariksetia If you're passing a list of length N your text should also be a list of length N and if the text that you're using doesn't match in their length (in tokens) you should also pass padding=True