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.91k stars 700 forks source link

How to export the GroundingDINO model to ONNX/TorchScript? #178

Open Tower0823 opened 1 year ago

Tower0823 commented 1 year ago

trans the C++ op MultiScaleDeformableAttnFunction to pytorch code, then solved the problem. But the exported output .onnx/.pt only support the fixed batch size like 1,2,4,8... Is there anyone know how to support dynamic input and output batch?

Dratlan commented 1 year ago

Can you please share your code to export grounding-dino to onnx? I guess this fixed batchSize is according to gpu nums?

TinyQi commented 1 year ago

老哥,可以分享一下你导出onnx模型的代码不?万分感谢