Thanks jakaskerl for the info!
I am now using the following approach:
while True:
if q_frame.has():
frame = q_frame.get().getCvFrame()
if q_nn.has():
dets = q_nn.get().detections
for detection in dets:
bbox = frame_norm(frame, (detection.xmin, detection.ymin,
detection.xmax, detection.ymax))
cv2.putText(frame, labels[detection.label], (bbox[0], bbox[3] + 13),
cv2.FONT_HERSHEY_SIMPLEX, 0.4, (255, 255, 255), 1)
cv2.putText(frame, f"{round(detection.confidence, 2)}", (bbox[0], bbox[3] + 25),
cv2.FONT_HERSHEY_SIMPLEX, 0.4, (255, 255, 255), 1)
cv2.rectangle(frame, (bbox[0], bbox[1]), (bbox[2], bbox[3]), (0, 0, 255), 2)