title: How to calculate bounding box coordinates?
body: <p>I've created a trained yolov4 model, and I tried to test it as well.
  My original image size was - width 1920 and height 1080.</p>
  <p>For training I reduced it to 416*416. When I was tested I got a good result but I cannot understand the output values:</p>
  <p>(left_x:  506   top_y: -376   width: 2076   height: 1179)</p>
  <p>(how can a coordinate be negative or bigger than the image's size?)</p>
  <p>I'm sure that there is a formula behind it but I wasn't be able to find it.
  I searched inside the code (darknet.py) and bbox2points(bbox) function returned a bad result.</p>
  <p>What am I missing?</p>
  <p>Can you help me to find the bounding box’s coordinate in this example?</p>
  <p>Code - darknet.py:</p>
  <pre class="lang-py prettyprint-override"><code>x, y, w, h = bbox
  xmin = int(round(x - (w / 2)))
  xmax = int(round(x + (w / 2)))
  ymin = int(round(y - (h / 2)))
  ymax = int(round(y + (h / 2)))
  return xmin, xmax, ymin, ymax
  </code></pre>
  <p>those x, y, w, h are the same as it is outputted (left_x, top_y, width, height)
  Code:
  <a href="https://github.com/AlexeyAB/darknet/blob/master/darknet.py" rel="nofollow noreferrer">https://github.com/AlexeyAB/darknet/blob/master/darknet.py</a></p>