IDEA-Research / GroundingDINO

[ECCV 2024] Official implementation of the paper "Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detection"
https://arxiv.org/abs/2303.05499
Apache License 2.0
6.83k stars 693 forks source link

Update inference.py #299

Open AshwinUnnikrishnan opened 9 months ago

AshwinUnnikrishnan commented 9 months ago

Adding additional function transform_image.. so that users can use a loaded RGB image and transform it to the expected format of grounding dino prediction.

AshwinUnnikrishnan commented 9 months ago

Enhanced the inference.py script to support image transformation for in-memory images.

Previously, the script only supported loading and transforming images from a file path. This enhancement allows users to transform images that have been uploaded or generated within their code, which is particularly useful when working with outputs from other models like super-resolution models.