DeepStream 9.0 YOLOv8 Face Detection: Bounding Box Correct on First Run but Shifts Right on Subsequent Runs

Please provide complete information as applicable to your setup.

• Hardware Platform : GPU
• DeepStream Version : 9.0
• TensorRT Version : 10.14.1.48
• NVIDIA GPU Driver Version : 590
• Docker image : nvcr.io/nvidia/deepstream:9.0-triton-multiarch

while deploying a custom YOLOv8 face detection model in DeepStream. The model was trained using Ultralytics, exported from .pt to .onnx, and integrated into DeepStream using a custom parser developed with reference to the DeepStream-Yolo repository (DeepStream-Yolo GitHub Repository). The model runs successfully in the DeepStream test3 application and detections are generated. However, the bounding box position becomes increasingly incorrect across successive runs.

On the first run, the face bounding box is correctly aligned with the detected face. After stopping and running the application again, the bounding box shifts noticeably toward the right side of the face. If I stop and run it a third time, the bounding box shifts even further to the right. This behavior continues despite using the same ONNX model, TensorRT engine, parser library, and DeepStream configuration files

dstest3_pgie_config.txt (636 Bytes)

This is a bug in the third-party repository regarding DS-9.0; while DS-9.0 introduced a bounding box (bbox) angle parameter, the rotation_angle was not initialized in this project. Please refer to the code snippet below.

  binfo[x_id].left = bx1;
  binfo[x_id].top = by1;
  binfo[x_id].width = fminf(float(netW), fmaxf(float(0.0), bx2 - bx1));
  binfo[x_id].height = fminf(float(netH), fmaxf(float(0.0), by2 - by1));
  binfo[x_id].detectionConfidence = maxProb;
  binfo[x_id].classId = maxIndex;

+  binfo[x_id].rotation_angle = 0.0;