Grounding Dino in Deepstream-app

Is it possible to Deploy and build an engine on a Jetson device using deepstream-app and the grounding-dino model? nv-grounding-dino Model by NVIDIA | NVIDIA NIM

I have searched and cant find any config file examples for grounding Dino.

As an example what properties are required for “grounding_dino_swin_tiny_commercial_deployable_v1.0”

offsets
net-scale-factor
output-blob-names
parse-bbox-func-name
custom-lib

Jetso Xavier NX
Jetpack 4.6

Thanks.

I have also looked at the notebook. tao_tutorials/notebooks/tao_launcher_starter_kit/grounding_dino/finetune_grounding_dino.ipynb at main · NVIDIA/tao_tutorials · GitHub

But it’s still not clear if this can be deployed on a Jetson device using DeepStream-app

Hi @BarcaBear
Please refer to the code in tao_deploy/nvidia_tao_deploy/cv/grounding_dino/scripts/inference.py at main · NVIDIA/tao_deploy · GitHub and tao_deploy/nvidia_tao_deploy/utils/image_batcher.py at main · NVIDIA/tao_deploy · GitHub.

  • Mean: [0.485, 0.456, 0.406]
  • Std: [0.229, 0.224, 0.225]

In DeepStream , you may set

  • Offsets: Use the mean values: 0.485,0.456,0.406
  • Net Scale Factor: Use 1/255 (i.e., 0.003921569)

For onnx output, you can download tao onnx model from GPU-optimized AI, Machine Learning, & HPC Software | NVIDIA NGC | NVIDIA NGC.

In GPU-optimized AI, Machine Learning, & HPC Software | NVIDIA NGC | NVIDIA NGC, it mentions,

Output

Output Type(s): Bounding Boxes and Confidence Scores for each detected object in the input image.
Output Formats: One Dimensional (1D), Two Dimensional (2D) vectors
Other Properties Related to Output:

  • pred_logits: B x 900 (Batch Size x Number of Queries)
  • pred_boxes: B x 900 x 4 (Batch Size x Number of Queries x Coordinates in cxcywh format)

Thanks for the feedback!

I had read those posts.

I’m looking for an example pgie config file. For example deepstream_tao_apps/configs/nvinfer at master · NVIDIA-AI-IOT/deepstream_tao_apps · GitHub

Can you provide information on how to create/find info on-
output-blob-names
parse-bbox-func-name
custom-lib-path

This way we can build the .engine when running deepstream-app.

In Grounding DINO | NVIDIA NGC, it mentions,

Output Type(s): Bounding Boxes and Confidence Scores for each detected object in the input image.
Output Formats: One Dimensional (1D), Two Dimensional (2D) vectors
Other Properties Related to Output:

  • pred_logits: B x 900 (Batch Size x Number of Queries)
  • pred_boxes: B x 900 x 4 (Batch Size x Number of Queries x Coordinates in cxcywh format)

So the “output-blob-names” should be “pred_logits;pred_boxes”.

The postprocessing function and library should be implemented by yourself according to the definition of the output tensors. We have some samples to show how to use the APIs. deepstream_tao_apps/apps/tao_others/deepstream_lpr_app/nvinfer_custom_lpr_parser at master · NVIDIA-AI-IOT/deepstream_tao_apps.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks