Algorithm for finding bounding boxes when using Dnn.readNetFromModelOptimizer

my code is as below:

import numpy as np
import argparse
import imutils
import time
import cv2


rootPath   = "E:\var\intel\vehicle-detection-0200\FP16\"
modelName  = "vehicle-detection-0200"   # download from intel open model zoo
irXmlFile  = rootPath + modelName+".xml"
irBinFile  = rootPath + modelName+".bin"
imagefile  = "./vid03_023860.jpg"
COLORS     = np.random.uniform(0, 255, size=(80, 3))

net = cv2.dnn.readNetFromModelOptimizer(irXmlFile, irBinFile)

frame = cv2.imread(imagefile)

out_blob = cv2.dnn.blobFromImage(frame, size=(672, 384))
res = net.forward()
classid_str = "classid"
probability_str = "probability"
label_str = "label"
number_top = 5 
print("before, out size:", res.shape)
out = res.reshape(-1, 7)
print("after, out size:", out.shape)
count =-1
print("shape H-0:", frame.shape[0])
print("shape W-1:", frame.shape[1])
for detection in out:
    count += 1
    confidence = float(detection[2])
    if confidence < 0.6:

    xmin = int(detection[3] * frame.shape[1])
    ymin = int(detection[4] * frame.shape[0])
    xmax = int(detection[5] * frame.shape[1])
    ymax = int(detection[6] * frame.shape[0])
    print(count, ".confidence=", confidence, "[lx,ty,rxby]=", xmin, ymin, xmax, ymax)
    if confidence > 0.5:
        #cv2.rectangle(frame, (xmin, ymin), (xmax, ymax), color=(0, 255, 0))
        cv2.rectangle(frame, (xmin, ymin), (xmax, ymax), color=COLORS[count])

cv2.imshow('OpenVINO face detection', frame)
key = cv2.waitKey(0)

If I change the model (IR files) to below model (obtaining from openvino)


Then the code can not find any bounding boxes, even the above two different model can be read with

 cv2.dnn.readNetFromModelOptimizer(irXmlFile, irBinFile)

I wonder the algorithm for finding bounding boxes differs from the type of nural network, right ?

If I am correct, where can I find the algorithm for finding bounding boxes of every neural network ?

I think you have to read paper.
Which model is it?

What happen if you comment out this?

#if confidence < 0.6: