Grounding DINO, MM-Grounding-DINO and LLMDet (open-vocabulary, Swin-T / B / L)
IDEA Research's Grounding DINO and OpenMMLab's MM-Grounding-DINO (tiny, base; Swin backbone, BERT text encoder): open-vocabulary detector, finds boxes for class names given as text at call time (default: the 80 COCO classes). Apache-2.0 code and weights.
experimental Fork of huggingface/transformers@c4c4605 · backends: portable, kernels
- Paper Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detection ECCV 2024 · first released 9 Mar 2023
- Authors’ code IDEA-Research/GroundingDINO (PyTorch), not the code forked here: fastforks follows the Hugging Face transformers port, which loads the IDEA-Research/grounding-dino-* weights, instead of the authors' repository.
- Authors’ code open-mmlab/mmdetection (PyTorch), not the code forked here: The MM-Grounding-DINO authors' code lives in MMDetection; fastforks follows the Hugging Face transformers port that loads the converted weights.
Paper 2023 Added in 0.2.0 Evaluated with 0.3.0
Use it
pip install fastforks Lean install with only what this model needs: pip install "fastforks-core[transformers]"
from fastforks import detection
model = detection.load("grounding-dino-tiny") # fastest backend that runs here
result = model("photo.jpg", text=["a cat", "a dog"]) # what to look for
# result fields: boxes, scores, labels
boxes = result.boxes # a torch tensor
arrays = result.numpy() # the tensor fields as NumPy arrays: arrays["boxes"]
result.backend # what ran: mode, device, dtype
Other ways to run it
- Backend:
detection.load("grounding-dino-tiny", mode="kernels") # or "portable", "auto" (default) - Precision:
detection.load("grounding-dino-tiny", dtype="float32") # full precision: slower, portable only - Options:
detection.load("grounding-dino-tiny", options={"score_threshold": 0.25, "max_detections": 100})
fastforks bench grounding-dino-tiny Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32transformers GroundingDinoForObjectDetection + processor (CPU), coco-80 caption, text tower per call | fp32 | 274 | 0.73× | 2,305 MiB/2,424 MiB | 4.1 | 1.18 |
| Original fp16torch.autocast(float16) around the call; transformers GroundingDinoForObjectDetection + processor (CPU), coco-80 caption, text tower per call | fp16 | 199 | – | 2,541 MiB/2,716 MiB | 1.4 | 0.34 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| PortableSynthetic 800 × 1344 image and default COCO vocabulary through the full public API. | fp16 | 110 | 1.8× | 987 MiB/1,106 MiB | 2.7 | 0.46 |
| KernelsSynthetic 800 × 1344 image and default COCO vocabulary through the full public API. | fp16 | 86.9 | 2.3× | 987 MiB/1,106 MiB | 2.7 | 0.43 |
| Portable + torch.compile | 111 | 1.8× | 2,550 MiB/2,664 MiB | 73 (build) | – | |
| TensorRT fp32fixed 80-class text prompt only | fp32 | 116 | 1.7× | 826 MiBenginenot comparable | 104 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-12 to 2026-11-20. First call, two warm-up calls, median of five synchronized full API calls. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
| Device | Backend | dtype | ms / call | Peak memory | Load / first call (s) | Output vs reference | Input |
|---|---|---|---|---|---|---|---|
| NVIDIA runs on Linux and Windows | |||||||
| NVIDIA L4 CUDA, torch 2.14.1+cu130, 2026-11-29 | Portable | fp16 | 134 | 963 MiB/1,126 MiB | 12.4 / 1.4 | matches | 800x1344 |
| Kernels | fp16 | 104 | 963 MiB/1,126 MiB | 8.2 / 0.6 | matches | 800x1344 | |
| NVIDIA L40S CUDA, torch 2.14.1+cu130, 2026-11-30 | Portable | fp16 | 44.9 | 963 MiB/1,126 MiB | 8.3 / 0.9 | matches | 800x1344 |
| Kernels | fp16 | 40.2 | 963 MiB/1,126 MiB | 6.6 / 0.4 | matches | 800x1344 | |
| NVIDIA A10 CUDA, torch 2.14.1+cu130, 2026-11-30 | Portable | fp16 | 105 | 963 MiB/1,126 MiB | 6.9 / 0.9 | matches | 800x1344 |
| Kernels | fp16 | 84.2 | 963 MiB/1,126 MiB | 5.3 / 0.3 | matches | 800x1344 | |
| Apple silicon runs on macOS | |||||||
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-13 | Original | fp32 | 912 | 4,899 MiB process | 11.5 / 2.2 | – | 800x1344 |
| Portable | fp32 | 846 | 4,787 MiB process | 8.8 / 1.8 | matches | 800x1344 | |
| Kernels | fp32 | not implemented | – | – | 800x1344 | ||
| Apple M1 Pro 16 GB (MLX, fp16) MLX, torch 2.14.1, 2026-11-28 | Portable | fp16 | 387 | 1,525 MiB process | 0.6 / 1.4 | matches | 800x1344 |
| Portable | fp32 | 463 | 2,049 MiB process | 1.1 / 1.6 | matches | 800x1344 | |
| Kernels | fp32 | not implemented | – | – | 800x1344 | ||
CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.
Licence and weights
Commercial use allowed
- Code
- Apache-2.0
- Weights
- Apache-2.0 source
- Training data
-
- Objects365 (train, box annotations) CC-BY-4.0, non-commercial
Our reading of the licences, not legal advice.
Weights
gdino-tiny.config.json 1.6 KB· hosted on Hugging Facegdino-tiny.model.safetensors 689 MB· hosted on Hugging Facebert-uncased.vocab.txt 232 KB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download grounding-dino-tiny).
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
COCO val2017
every 10th image, box mAP
| Run | dtype | box mAP ↑ | Δ box mAP vs fp32 original | images | ms / image |
|---|---|---|---|---|---|
| Original fp32 | fp32 | 51.08 | reference | 500 | – |
| Original fp16 | fp16 | 51.16 | +0.08 | 500 | – |
| Portable fp32 | fp32 | 51.12 | +0.04 | 500 | – |
| Portable | fp16 | 51.14 | +0.06 | 500 | – |
| Kernels | fp16 | 51.04 | −0.04 | 500 | – |
pycocotools COCOeval of the top 100 detections per image. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-12; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 9e3ff83d+dir, 2026-11-17; portable: RTX 5060 Ti, torch 2.14.1+cu130, fastforks a981ff86, 2026-11-12; kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 67dbea00e, 2026-11-20.
COCO val2017
every 10th image at fixed 320 x 320, box mAP
| Run | dtype | box mAP ↑ | images | ms / image |
|---|---|---|---|---|
| Original fp32 | not measured | |||
| Original fp16 | not measured | |||
| Portable fp32 | fp32 | 35.30 | 500 | – |
| Portable | not measured | |||
| Kernels | not measured | |||
The original code was not run on this dataset, so the table cannot show the distance to it.
pycocotools COCOeval of the top 100 detections per image. Fixed FP32 graph, one prepared prompt for all 80 COCO class names. Score the top 100 query/class pairs per image. The public TensorRT exporter remains gated. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks 29b3bbad, 2026-11-18.
COCO val2017
50 images at fixed 320 x 320, box mAP
| Run | dtype | box mAP ↑ | images | ms / image |
|---|---|---|---|---|
| Original fp32 | not measured | |||
| Original fp16 | not measured | |||
| Portable fp32 | fp32 | 34.92 | 50 | – |
| Portable | not measured | |||
| Kernels | not measured | |||
The original code was not run on this dataset, so the table cannot show the distance to it.
pycocotools COCOeval of the top 100 detections per image. The same FP32 320 x 320 preparation and top 100 predictions for all 80 classes, restricted to every 100th validation image in filename order. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks 29b3bbad, 2026-11-18.
COCO val2017
every 10th image at fixed 800 x 1344, box mAP
| Run | dtype | box mAP ↑ | images | ms / image |
|---|---|---|---|---|
| Original fp32 | not measured | |||
| Original fp16 | not measured | |||
| Portable fp32 | fp32 | 49.85 | 500 | – |
| Portable | not measured | |||
| Kernels | not measured | |||
The original code was not run on this dataset, so the table cannot show the distance to it.
pycocotools COCOeval of the top 100 detections per image. Resize the same 500 RGB inputs to 800 x 1344. Use one prepared prompt for all 80 COCO classes and score the top 100 query/class pairs per image. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks d9caeca2, 2026-11-19.
COCO val2017
all 5000 images, box mAP
| Run | dtype | box mAP ↑ | Δ box mAP vs fp32 original | images | ms / image |
|---|---|---|---|---|---|
| Original fp32 | fp32 | 48.25 | reference | 5000 | – |
| Original fp16 | not measured | ||||
| Portable fp32 | not measured | ||||
| Portable | fp16 | 48.25 | ±0.00 | 5000 | – |
| Kernels | not measured | ||||
pycocotools COCOeval of the top 100 detections per image. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-12; portable: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 84ba91d4, 2026-11-12.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.25 and p99 <= 0.8 (absolute error of the output boxes).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.002 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.25 | 0.12884 |
| GPU default dtypes, p99 |diff| | ≤ 0.8 | 0.53156 |
Recorded for grounding-dino-tiny on RTX 5060 Ti, torch 2.10.0+cu130, 2026-11-17, with these kernels: msda
Details
Grounding DINO (Liu et al. 2023, IDEA Research): open-set detection that fuses a Swin image backbone with a BERT text encoder in a DINO-style deformable transformer; each of 900 queries scores every caption token. MM-Grounding-DINO (Zhao et al. 2024, OpenMMLab) is the same network with a scaled, biased contrastive class head and unshared decoder heads, retrained on Objects365, GoldG and V3Det (the `large` variant also on GRIT). LLMDet (Fu et al. 2025, SYSU) is the MM-Grounding-DINO network (same code, same loader) fine-tuned with a large language model's region and image captions as extra supervision; the checkpoints contain the detector only. Pass `text=[...]` at call time (default: the 80 COCO class names), joined into one caption; a class score is the mean token score of its name. Images are resized to 800 px on the short side (at most 1333 on the long side). The portable `module()` is the image side with the COCO caption's text features as constants.
- Input / output
- Input: one RGB image. Output: boxes, class labels, scores and instance masks.
- Input size
- any H x W >= 32, padded to a multiple of 32; tested up to 3000x4000 (1,373 MiB allocated)
- Options
score_threshold=0.250.0 to 1.0· changes the outputmax_detections=100>= 1· changes the output
- Outputs
boxes,scores,labels- CUDA kernels
msda
- Apple (MPS)
- fp32
Limitations
- Requires the optional transformers library (the network is its `GroundingDinoForObjectDetection`).
- The original in the benchmarks and goldens is the Hugging Face transformers 5.19.0 port with the authors' weights (IDEA-Research/grounding-dino-*, openmmlab-community/mm_grounding_dino_*); the official GroundingDINO and mmdetection code (their CUDA deformable-attention ops) was not run.
- Class names are joined into one caption of at most 256 tokens (about 100 short names); a longer list raises an error instead of being split into several passes.
- No phrase output: `labels` index into the given names (the token-level text threshold of the Hugging Face post-processing is not used).
- llmdet-* and mm-grounding-dino-large: the original in the goldens is transformers' MMGroundingDinoForObjectDetection with the converted weights (openmmlab-community, iSEE-Laboratory); the mmdetection and LLMDet code was not run.
- grounding-dino-base was trained with COCO (and RefCOCO, ODinW) data: its COCO numbers are not zero-shot.
Full reference, generated from the repository
IDEA Research's Grounding DINO and OpenMMLab's MM-Grounding-DINO (tiny, base; Swin backbone, BERT text encoder): open-vocabulary detector, finds boxes for class names given as text at call time (default: the 80 COCO classes). Apache-2.0 code and weights.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
grounding-dino-tiny | synthetic (800x1344) | original portable kernels portable + torch.compile TensorRT fp32 | 199 110 86.9 111 116 (fixed 80-class text prompt) | 2541 / 2716 987 / 1106 987 / 1106 2550 / 2664 883 / 888 |
grounding-dino-tiny | synthetic (320x320) | original portable kernels TensorRT fp32 | – 69.0 55.4 13.6 (network with fixed COCO prompts, standalone build) | – 841 / 948 841 / 948 387 / 406 |
grounding-dino-base | synthetic (800x1344) | original portable kernels portable + torch.compile TensorRT fp32 | 230 132 109 131 159 (fixed 80-class text prompt) | 2895 / 3094 1105 / 1322 1105 / 1322 2669 / 2800 1153 / 1160 |
grounding-dino-base | 320x320 | original portable kernels TensorRT fp32 | – – – 17.6 (fixed 80-class text prompt) | – – – 609 / 628 |
mm-grounding-dino-tiny | synthetic (800x1344) | original portable kernels portable + torch.compile TensorRT fp32 | 202 110 87.2 111 116 (fixed 80-class text prompt) | 2541 / 2716 989 / 1108 989 / 1108 2555 / 2666 883 / 890 |
mm-grounding-dino-tiny | synthetic (320x320) | original portable kernels TensorRT fp32 | – 69.2 55.5 13.8 (network with fixed COCO prompts, standalone build) | – 842 / 950 842 / 950 387 / 408 |
mm-grounding-dino-base | synthetic (800x1344) | original portable kernels portable + torch.compile TensorRT fp32 | 232 132 110 132 158 (fixed 80-class text prompt) | 2895 / 3094 1107 / 1324 1107 / 1324 2669 / 2800 1153 / 1160 |
mm-grounding-dino-base | 320x320 | original portable kernels TensorRT fp32 | – – – 17.7 (fixed 80-class text prompt) | – – – 641 / 662 |
mm-grounding-dino-large | synthetic (800x1344) | original portable kernels portable + torch.compile TensorRT fp16 | 849 452 344 359 378 | 9329 / 9914 2484 / 3150 2484 / 3148 3285 / 3488 2915 / 2964 |
llmdet-tiny | synthetic (800x1344) | original portable kernels portable + torch.compile TensorRT fp16 | 201 103 80.5 80.1 82.4 | 2544 / 2720 989 / 1108 989 / 1108 1186 / 1226 1113 / 1166 |
llmdet-base | synthetic (800x1344) | original portable kernels portable + torch.compile TensorRT fp16 | 229 126 103 98.7 95.0 | 2898 / 3098 1107 / 1324 1107 / 1324 1304 / 1344 1339 / 1372 |
llmdet-large | synthetic (800x1344) | original portable kernels portable + torch.compile TensorRT fp16 | 849 450 343 358 376 | 9329 / 9914 2484 / 3150 2484 / 3148 3285 / 3488 2915 / 2964 |
Details
- Original code: https://github.com/huggingface/transformers at
c4c4605f9618 - Code licence: Apache-2.0 (permissive); files:
- Weights licence: Apache-2.0
- Licence evidence: https://huggingface.co/IDEA-Research/grounding-dino-tiny/blob/a2bb814dd30d776dcf7e30523b00659f4f141c71/README.md
- Training data: Objects365 (train, box annotations) (Grounding DINO-T: Objects365, GoldG (Flickr30k Entities + GQA / Visual Genome images) and Cap4M (web image-caption pairs with pseudo-boxes); GoldG and Cap4M have no dataset id here (paper arXiv:2303.05499 table 2; the authors' model table).)
grounding-dino-base: COCO 2017 (train, instance annotations), Objects365 (train, box annotations) (Grounding DINO-B: COCO, Objects365, GoldG (Flickr30k Entities + GQA / Visual Genome images), Cap4M (web image-caption pairs with pseudo-boxes), OpenImages, ODinW-35 and RefCOCO; only COCO and Objects365 have dataset ids here (the authors' model table, github.com/IDEA-Research/GroundingDINO README).)mm-grounding-dino-tiny: Objects365 (train, box annotations) (MM-Grounding-DINO-T (o365v1_goldg_v3det): Objects365 v1, GoldG (Flickr30k Entities + GQA / Visual Genome images) and V3Det; no COCO, so its COCO numbers are zero-shot (mmdetection configs/mm_grounding_dino README; paper arXiv:2401.02361).)mm-grounding-dino-base: Objects365 (train, box annotations) (MM-Grounding-DINO-B (o365v1_goldg_v3det): Objects365 v1, GoldG (Flickr30k Entities + GQA / Visual Genome images) and V3Det; no COCO, so its COCO numbers are zero-shot (mmdetection configs/mm_grounding_dino README; paper arXiv:2401.02361).)mm-grounding-dino-large: Objects365 (train, box annotations) (MM-Grounding-DINO-L (large_all): Objects365 v1, GoldG (Flickr30k Entities + GQA / Visual Genome images), GRIT and V3Det. Theallrecipe's exact data list is in the mmdetection configs/mm_grounding_dino README (not re-checked here), so its COCO numbers are not claimed as zero-shot (paper arXiv:2401.02361).)llmdet-tiny: Objects365 (train, box annotations) (LLMDet (GroundingCap-1M: GoldG grounding data with LLM-generated region and image captions; Objects365 and V3Det as in MM-Grounding-DINO); the data list is from the paper and card (not re-checked against the training configs), so COCO numbers are not claimed as zero-shot; only Objects365 has a dataset id here (paper arXiv:2501.18954).)llmdet-base: Objects365 (train, box annotations) (LLMDet (GroundingCap-1M: GoldG grounding data with LLM-generated region and image captions; Objects365 and V3Det as in MM-Grounding-DINO); the data list is from the paper and card (not re-checked against the training configs), so COCO numbers are not claimed as zero-shot; only Objects365 has a dataset id here (paper arXiv:2501.18954).)llmdet-large: Objects365 (train, box annotations) (LLMDet (GroundingCap-1M: GoldG grounding data with LLM-generated region and image captions; Objects365 and V3Det as in MM-Grounding-DINO); the data list is from the paper and card (not re-checked against the training configs), so COCO numbers are not claimed as zero-shot; only Objects365 has a dataset id here (paper arXiv:2501.18954).)
- Options:
score_threshold= 0.25 (0.0 to 1.0),max_detections= 100 (>= 1) - Kernel libraries:
msda - Variants:
grounding-dino-tiny,grounding-dino-base,mm-grounding-dino-tiny,mm-grounding-dino-base,mm-grounding-dino-large,llmdet-tiny,llmdet-base,llmdet-large - Outputs: boxes, scores, labels; label_set:
coco-80 - Input size: any H x W >= 32, padded to a multiple of 32
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
grounding-dino-tiny3000x4000 (1.3 GiB peak allocated, 1.5 reserved);grounding-dino-base3000x4000 (1.5 GiB peak allocated, 1.7 reserved);mm-grounding-dino-tiny3000x4000 (1.3 GiB peak allocated, 1.5 reserved);mm-grounding-dino-base3000x4000 (1.5 GiB peak allocated, 1.7 reserved);mm-grounding-dino-large3000x4000 (2.3 GiB peak allocated, 3.1 reserved);llmdet-tiny3000x4000 (1.0 GiB peak allocated, 1.4 reserved);llmdet-base3000x4000 (1.2 GiB peak allocated, 1.5 reserved);llmdet-large3000x4000 (2.3 GiB peak allocated, 3.1 reserved) grounding-dino-tiny800x1344, first call: portable + torch.compile 73 s (cold Inductor cache), TensorRT fp32 104 s (ONNX + engine).grounding-dino-base800x1344, first call: portable + torch.compile 98 s (cold Inductor cache), TensorRT fp32 130 s (ONNX + engine).grounding-dino-base320x320, first call: TensorRT fp32 119 s (ONNX + engine).mm-grounding-dino-tiny800x1344, first call: portable + torch.compile 71 s (cold Inductor cache), TensorRT fp32 104 s (ONNX + engine).mm-grounding-dino-base800x1344, first call: portable + torch.compile 105 s (cold Inductor cache), TensorRT fp32 125 s (ONNX + engine).mm-grounding-dino-base320x320, first call: TensorRT fp32 134 s (ONNX + engine).mm-grounding-dino-large800x1344, first call: portable + torch.compile 175 s (cold Inductor cache), TensorRT fp16 185 s (ONNX + engine).llmdet-tiny800x1344, first call: portable + torch.compile 151 s (cold Inductor cache), TensorRT fp16 164 s (ONNX + engine).llmdet-base800x1344, first call: portable + torch.compile 145 s (cold Inductor cache), TensorRT fp16 166 s (ONNX + engine).llmdet-large800x1344, first call: portable + torch.compile 174 s (cold Inductor cache), TensorRT fp16 183 s (ONNX + engine).grounding-dino-tinyoriginal 800x1344: torch.autocast(float16) around the call; transformers GroundingDinoForObjectDetection + processor (CPU), coco-80 caption, text tower per callgrounding-dino-tinyportable 800x1344, kernels 800x1344: Synthetic 800 × 1344 image and default COCO vocabulary through the full public API.grounding-dino-tinyportable 320x320: Full public call on a 320 x 320 image, resized to 800 x 800. The standalone TensorRT row times the fixed 320 x 320 normalized network input.grounding-dino-tinykernels 320x320: Existing CUDA kernel mode on one fixed input with five warm calls.grounding-dino-baseoriginal 800x1344: torch.autocast(float16) around the call; transformers GroundingDinoForObjectDetection + processor (CPU), coco-80 caption, text tower per callgrounding-dino-baseportable 800x1344, kernels 800x1344: Synthetic 800 × 1344 image and default COCO vocabulary through the full public API.mm-grounding-dino-tinyoriginal 800x1344: torch.autocast(float16) around the call; transformers MMGroundingDinoForObjectDetection + processor (CPU), coco-80 caption, text tower per callmm-grounding-dino-tinyportable 800x1344, kernels 800x1344: Synthetic 800 × 1344 image and default COCO vocabulary through the full public API.mm-grounding-dino-tinyportable 320x320: Full public call on a 320 x 320 image, resized to 800 x 800. The standalone TensorRT row times the fixed 320 x 320 normalized network input.mm-grounding-dino-tinykernels 320x320: Existing CUDA kernel mode on one fixed input with five warm calls.mm-grounding-dino-baseoriginal 800x1344: torch.autocast(float16) around the call; transformers MMGroundingDinoForObjectDetection + processor (CPU), coco-80 caption, text tower per callmm-grounding-dino-baseportable 800x1344, kernels 800x1344: Synthetic 800 × 1344 image and default COCO vocabulary through the full public API.mm-grounding-dino-largeoriginal 800x1344: torch.autocast(float16) around the call; transformers MMGroundingDinoForObjectDetection + processor (CPU), coco-80 caption, text tower per callllmdet-tinyoriginal 800x1344: torch.autocast(float16) around the call; transformers MMGroundingDinoForObjectDetection + processor (CPU), coco-80 caption, text tower per callllmdet-baseoriginal 800x1344: torch.autocast(float16) around the call; transformers MMGroundingDinoForObjectDetection + processor (CPU), coco-80 caption, text tower per callllmdet-largeoriginal 800x1344: torch.autocast(float16) around the call; transformers MMGroundingDinoForObjectDetection + processor (CPU), coco-80 caption, text tower per callgrounding-dino-tinyload / first call: original 4.06 s / 1.176 s, portable 3.01 s / 0.508 s, kernels 4.14 s / 0.422 s (320x320)grounding-dino-baseload / first call: original 4.16 s / 0.989 s, portable 3.29 s / 0.527 s, kernels 4.22 s / 0.449 smm-grounding-dino-tinyload / first call: original 4.17 s / 0.99 s, portable 3.26 s / 0.517 s, kernels 3.42 s / 0.43 s (320x320)mm-grounding-dino-baseload / first call: original 4.1 s / 1.029 s, portable 3.33 s / 0.527 s, kernels 4.67 s / 0.453 smm-grounding-dino-largeload / first call: original 4.77 s / 1.843 s, portable 4.22 s / 0.781 s, kernels 3.56 s / 0.684 sllmdet-tinyload / first call: original 4.05 s / 1.046 s, portable 5.03 s / 0.478 s, kernels 3.16 s / 0.445 sllmdet-baseload / first call: original 4.14 s / 0.99 s, portable 5.89 s / 0.495 s, kernels 3.27 s / 0.464 sllmdet-largeload / first call: original 4.23 s / 1.838 s, portable 3.51 s / 0.783 s, kernels 3.36 s / 0.666 s- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
pycocotools COCOeval of the top 100 detections per image. Fixed FP32 graph, one prepared prompt for all 80 COCO class names. Score the top 100 query/class pairs per image. The public TensorRT exporter remains gated. The same FP32 320 x 320 preparation and top 100 predictions for all 80 classes, restricted to every 100th validation image in filename order. Resize the same 500 RGB inputs to 800 x 1344. Use one prepared prompt for all 80 COCO classes and score the top 100 query/class pairs per image. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | portable fp32 | kernels | portable + torch.compile | TensorRT | note |
|---|---|---|---|---|---|---|---|---|---|
grounding-dino-tiny | COCO val2017, every 10th image, box mAP | 51.08 | 51.16 | 51.14 | 51.12 | 51.04 | |||
grounding-dino-tiny | COCO val2017, every 10th image at fixed 320 x 320, box mAP | 35.30 | 35.47 | ||||||
grounding-dino-tiny | COCO val2017, 50 images at fixed 320 x 320, box mAP | 34.92 | 34.92 | ||||||
grounding-dino-tiny | COCO val2017, every 10th image at fixed 800 x 1344, box mAP | 49.85 | 49.80 | ||||||
grounding-dino-tiny | COCO val2017, all 5000 images, box mAP | 48.25 | 48.25 | ||||||
grounding-dino-base | COCO val2017, every 10th image, box mAP | 55.67 | 55.73 | 55.72 | 57.13 | 57.12 | |||
grounding-dino-base | COCO val2017, every 10th image at fixed 320 x 320, box mAP | 39.83 | 39.76 | ||||||
grounding-dino-base | COCO val2017, every 10th image at fixed 800 x 1344, box mAP | 56.21 | 56.15 | ||||||
mm-grounding-dino-tiny | COCO val2017, every 10th image, box mAP | 51.49 | |||||||
mm-grounding-dino-tiny | COCO val2017, every 10th image at fixed 320 x 320, box mAP | 35.77 | 35.79 | ||||||
mm-grounding-dino-tiny | COCO val2017, every 10th image at fixed 800 x 1344, box mAP | 50.14 | 50.05 | ||||||
mm-grounding-dino-tiny | COCO val2017, every 20th image, box mAP | 55.18 | 54.92 | 55.40 | 54.99 | ||||
mm-grounding-dino-base | COCO val2017, every 10th image, box mAP | 53.01 | |||||||
mm-grounding-dino-base | COCO val2017, every 10th image at fixed 320 x 320, box mAP | 35.64 | 35.60 | ||||||
mm-grounding-dino-base | COCO val2017, every 10th image at fixed 800 x 1344, box mAP | 52.09 | 52.23 | ||||||
mm-grounding-dino-base | COCO val2017, every 20th image, box mAP | 57.11 | 56.94 | 56.94 | 56.89 | ||||
mm-grounding-dino-large | COCO val2017, every 20th image, box mAP | 63.92 | 64.00 | ||||||
llmdet-tiny | COCO val2017, every 20th image, box mAP | 59.78 | 59.54 | ||||||
llmdet-base | COCO val2017, every 20th image, box mAP | 61.71 | 61.61 | ||||||
llmdet-large | COCO val2017, every 20th image, box mAP | 62.93 | 62.72 |
Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 84ba91d4 / a981ff86 / aee4b565 / db01495e6, 2026-11-12 to 2026-11-28; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 29b3bbad / 912f67dd / 9e3ff83d+dirty / d9caeca2, 2026-11-17 to 2026-11-20; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 67dbea00e, 2026-11-20; compile: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 23765f70, 2026-11-19; tensorrt: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 29b3bbad / d9caeca2, 2026-11-18 to 2026-11-19.
Parity
CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.25 and p99 <= 0.8 (absolute error of the output boxes).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
grounding-dino-tiny | 0.12884 / 0.53156 | RTX 5060 Ti, torch 2.10.0+cu130 | msda@7db8a6f4e515:sm_120 |
grounding-dino-base | 0.16413 / 0.50577 | RTX 5060 Ti, torch 2.14.1+cu130 | msda@7db8a6f4e515:sm_120 |
mm-grounding-dino-tiny | 0.08186 / 0.19259 | RTX 5060 Ti, torch 2.10.0+cu130 | msda@7db8a6f4e515:sm_120 |
mm-grounding-dino-base | 0.08714 / 0.23686 | RTX 5060 Ti, torch 2.10.0+cu130 | msda@7db8a6f4e515:sm_120 |
mm-grounding-dino-large | 0.0716 / 0.19179 | RTX 5060 Ti, torch 2.14.1+cu130 | msda@7db8a6f4e515:sm_120 |
llmdet-tiny | 0.07512 / 0.15531 | RTX 5060 Ti, torch 2.14.1+cu130 | msda@7db8a6f4e515:sm_120 |
llmdet-base | 0.08991 / 0.2123 | RTX 5060 Ti, torch 2.14.1+cu130 | msda@7db8a6f4e515:sm_120 |
llmdet-large | 0.08225 / 0.20836 | RTX 5060 Ti, torch 2.14.1+cu130 | msda@7db8a6f4e515:sm_120 |
Limitations
- Requires the optional transformers library (the network is its
GroundingDinoForObjectDetection). - The original in the benchmarks and goldens is the Hugging Face transformers 5.19.0 port with the authors' weights (IDEA-Research/grounding-dino-, openmmlab-community/mm_grounding_dino_); the official GroundingDINO and mmdetection code (their CUDA deformable-attention ops) was not run.
- Class names are joined into one caption of at most 256 tokens (about 100 short names); a longer list raises an error instead of being split into several passes.
- No phrase output:
labelsindex into the given names (the token-level text threshold of the Hugging Face post-processing is not used). - llmdet-* and mm-grounding-dino-large: the original in the goldens is transformers' MMGroundingDinoForObjectDetection with the converted weights (openmmlab-community, iSEE-Laboratory); the mmdetection and LLMDet code was not run.
- grounding-dino-base was trained with COCO (and RefCOCO, ODinW) data: its COCO numbers are not zero-shot.
Example output
No example rendered for this checkpoint yet.