Answers.Body: <p>My assumption was correct: <strong>the ground truth bounding box is aligned with an anchor box such that they share the same center</strong></p>
  
  <p>In other words, only the widths and heights are used to calculate the ground truth IOU.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-25T04:11:15.277Z
Answers.LastActivityDate: 2018-05-25T04:11:15.277Z
Answers.UserDisplayName: nivter
Body: <p>I know how IOU works during detection. However, while preparing targets from ground-truth for training, how is the IOU between a given object and all anchor boxes calculated?</p>
  <p><strong>Is the ground truth bounding box aligned with an anchor box such that they share the same center? (width/2, height/2)</strong></p>
  <p>I think this is the case but I want to hear from someone who has better knowledge of how training data is prepared for training in YOLO.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-22T14:03:13.307Z
Comments.Text: Can you perhaps provide a bit more context about the system you are talking about?
Comments.UserDisplayName: Oliver Mason
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-22T14:19:17.413Z
Comments.Text: @OliverMason: Here's what I am talking about: https://pjreddie.com/darknet/yolo/
  
  In order to train, I need to prepare the training data. One of the fields is 'objectiveness factor' which is defined as IOU between the actual bounding box and best-fitting anchor box. My question is: how are these two boxes aligned?
Comments.UserDisplayName: nivter
Tags: <computer-vision><yolo><bounding-box><jaccard-similarity>
Title: How are IOUs for ground truth boxes in YOLO calculated?
UserDisplayName: nivter
ThreadText: # How are IOUs for ground truth boxes in YOLO calculated?
  
  (Asked by: username_0 on 2018-05-22)
  
  I know how IOU works during detection. However, while preparing targets from ground-truth for training, how is the IOU between a given object and all anchor boxes calculated?
  
  **Is the ground truth bounding box aligned with an anchor box such that they share the same center? (width/2, height/2)**
  
  I think this is the case but I want to hear from someone who has better knowledge of how training data is prepared for training in YOLO.
  
  **Tags:** computer-vision, yolo, bounding-box, jaccard-similarity
  > **Comments:**
  > **username_1**: Can you perhaps provide a bit more context about the system you are talking about?  
  > **username_0**: @OliverMason: Here's what I am talking about: https://pjreddie.com/darknet/yolo/  In order to train, I need to prepare the training data. One of the fields is 'objectiveness factor' which is defined as IOU between the actual bounding box and best-fitting anchor box. My question is: how are these two boxes aligned?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-05-25. Score: 2 | Accepted answer
  
  My assumption was correct: **the ground truth bounding box is aligned with an anchor box such that they share the same center**
  
  In other words, only the widths and heights are used to calculate the ground truth IOU.
  
  
  ---
  
  