SSD-MobileNet-V2 detection boxes issue: Bounding boxes larger than vehicle size

Hi everyone,

I’m using the Jetson-Inference library with the SSD-MobileNet-V2 model to detect vehicles. While the model performs well most of the time, I’ve noticed an issue where detection boxes are sometimes significantly larger than the actual vehicle, especially in certain scenarios.

I’ve tried filtering out detections with large width and height but wanted to know if there’s a better way to handle or prevent this issue. Is there any specific tuning or modification I can apply to the detectNet parameters or the model itself to improve bounding box accuracy?

Here’s a relevant snippet of my code for context:

// Detect vehicles with detectNet
detectNet::Detection* detections = nullptr;
const int numDetections = net->Detect(imgCUDA, frame.cols, frame.rows, &detections, detectNet::OverlayFlags::OVERLAY_NONE);

for (int i = 0; i < numDetections; i++) {
const detectNet::Detection& d = detections[i];
float width = d.Right - d.Left;
float height = d.Bottom - d.Top;

// Filtering overly large boxes (heuristic threshold)
if (width > frame.cols / 2 || height > frame.rows / 2) {
    continue; // Skip this detection
}

// Process the valid detections...

}

Any advice or insights on how to address this issue would be greatly appreciated!