# What bounding boxes format does Grounding DINO use?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwhat-bounding-boxes-format-does-grounding-dino-use%2F161851%3E%5C
**Category:** 🤗Transformers\
**Created:** [July 5, 2025, 7:16am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwhat-bounding-boxes-format-does-grounding-dino-use%2F161851 "2025-07-05T07:16:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kallinteris-Andreas](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/kallinteris-andreas/32/50408_2.png) [@Kallinteris-Andreas](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FKallinteris-Andreas)%5C
**Post date:** [July 5, 2025, 7:16am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwhat-bounding-boxes-format-does-grounding-dino-use%2F161851%2F1 "2025-07-05T07:16:49Z")

</div>

Grounding DINO in the `transformers` library uses the `AnnotationFormat.COCO_DETECTION`, but from what I can tell it format its bounding boxes in `[x_min, y_min, x_max, y_max]`, while COCO bounding boxes are `[x,y,width,height]`

references: [COCO - Common Objects in Context](https://cocodataset.org/#format-data), [Grounding DINO](https://huggingface.co/docs/transformers/en/model_doc/grounding-dino#transformers.GroundingDinoImageProcessor)

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [July 5, 2025, 9:16am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwhat-bounding-boxes-format-does-grounding-dino-use%2F161851%2F2 "2025-07-05T09:16:53Z")

</div>

I think it will be converted internally if you pass it in this format.

> **[Object detection](https://huggingface.co/docs/transformers/tasks/object_detection)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> The `image_processor` expects the annotations to be in the following format: `{'image_id': int, 'annotations': list[Dict]}`, where each dictionary is a COCO object annotation.

> [@Load a COCO format database from disk for DETR](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fload-a-coco-format-database-from-disk-for-detr%2F153752)%3A
>
> I have a COCO database in my disk (with a JSON in the annotations folder that contains image directions) and I would like to load it in HF dataset in orther to use CV models. Is there a function that allows that?

> <https://github.com/huggingface/transformers/blob/main/src/transformers/image_utils.py#L412>

> **[Grounding DINO](https://huggingface.co/docs/transformers/main/en/model_doc/grounding-dino#transformers.GroundingDinoImageProcessor.format)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.
