IDEA-Research / Grounding-DINO-1.5-API

API for Grounding DINO 1.5: IDEA Research's Most Capable Open-World Object Detection Model Series
https://arxiv.org/abs/2405.10300
Apache License 2.0
765 stars 22 forks source link

Good Job!!! When calling the API to output bbox, can I set the threshold? Found bbox score>0.2 #42

Open lidapengpeng opened 2 weeks ago

lidapengpeng commented 2 weeks ago

After actually testing various detectors, I found that Grounding DINO is indeed SOTA and performs very well on my own data!

When I called the API, I found that the input image resolution could not specify the size. Secondly, when outputting the results, I found that the bbox threshold score would only be output when it is above 0.2. I wanted to modify the threshold, such as greater than 0.1 manually, but I couldn't find where. Can you give me some suggestions for setting this parameter?

rentainhe commented 2 days ago

Hi @lidapengpeng

We use a uniform transformation method for the input image, so the users don't have to refine the input image size for detection. And I was wondering the scenarios in which you need to specify the size of the input image. Regarding the setting of the box threshold, we generally recommend using a fixed threshold for more stable detection results. However, it is true that there may be a need to adjust the box threshold in actual use. We will optimize our API calls to support the setting of this parameter.

rentainhe commented 1 day ago

@lidapengpeng We have already update our SDK API, you can set box threshold by setting bbox_threshold, here is an example:

pip install dds-cloudapi-sdk --upgrade
task = DetectionTask(
    image_url=image_url,
    prompts=[TextPrompt(text=TEXT_PROMPT)],
    targets=[DetectionTarget.BBox],  # detect bbox
    model=DetectionModel.GDino1_5_Pro,
    bbox_threshold=0.1,
)