title: Port Onnx model from MXNet to ONNXruntime: Confidence
body: <p>Since it is unlikely that I can use MXNet in my project, I am porting the use of an ONNX model from MXNet to ONNXruntime/OpenCV only.</p>
  <p>As an example I started with the model and Jupyter example here: <a href="https://github.com/onnx/models/tree/main/vision/object_detection_segmentation/duc" rel="nofollow noreferrer">https://github.com/onnx/models/tree/main/vision/object_detection_segmentation/duc</a></p>
  <p>The input data is prepared correctly and I get the same classes distribution in the resulting image as the Jupyter example. I just cannot make any t´sense of the confidence values. In the Jupyter example the returned values can be used directly and return values about 0.8.. something. The values are also assigned to a variable called softmax which helps.</p>
  <p>Using the model directly and the supplied example image &quot;city1.png&quot;, I get the highest return value at [953, 1277, 0] (y, x, c) with the following vales returned for the pixel:
  [1.5864590e-03 1.6979243e-11 4.0575922e-13 1.4085495e-14 1.2986613e-14
  2.7480461e-12 1.1304862e-16 1.2532284e-15 1.4964286e-12 1.2479502e-12
  1.6052645e-15 7.4490821e-12 6.1916245e-16 2.8219465e-13 1.9294035e-16
  1.4570375e-16 1.3588821e-14 2.2083811e-15 4.5215419e-15]</p>
  <p>I have tried to apply softmax to the values either image wide (for max and sum) and pixel vise. For the pixel vise version that returns the following value generated from the values above
  vec/sum [0.05271073 0.05262718 0.05262718 0.05262718 0.05262718 0.05262718
  0.05262718 0.05262718 0.05262718 0.05262718 0.05262718 0.05262718
  0.05262718 0.05262718 0.05262718 0.05262718 0.05262718 0.05262718
  0.05262718]</p>
  <p>Here is the softmax code I use:</p>
  <pre><code>                vec = labels[y,x]
                  max = np.max(vec)
                  vec -= max
                  vec = np.exp(vec)
                  sum = np.sum(vec)
                  vec /= sum
                  print('  vec/sum {}'.format(vec))
                  labels[y,x] = vec
  </code></pre>