title: Anchor Boxes in YOLO : How are they decided
body: <p>I have gone through a couple of <code>YOLO</code> tutorials but I am finding it some what hard to figure if the Anchor boxes for each cell the image is to be divided into is predetermined. In one of the guides I went through, The image was divided into <strong>13x13</strong> cells and it stated each cell predicts <strong>5</strong> anchor boxes(bigger than it, ok here's my first problem because it also says it would first detect what object is present in the small cell before the prediction of the boxes).</p>
  
  <p>How can the small cell predict  anchor boxes for an object bigger than it. Also it's said that each cell classifies before predicting its anchor boxes how can the small cell classify the right object in it without querying neighbouring cells if only a small part of the object falls within the cell </p>
  
  <p><code>E.g.</code> say one of the <strong>13</strong> cells contains only the white pocket part of a man wearing a T-shirt how can that cell classify correctly that a man is present without  being linked to its neighbouring cells? with a normal CNN when trying to localize a single object I know the bounding box prediction relates to the whole image so at least I can say the network has an idea of what's going on everywhere on the image before deciding where the box should be.</p>
  
  <p><strong>PS:</strong> What I currently think of how the YOLO works is basically each cell is assigned  predetermined anchor boxes with a classifier at each end before the boxes with the highest scores for each class is then selected but I am sure it doesn't add up somewhere. </p>
  
  <blockquote>
    <p><strong>UPDATE:</strong> Made a mistake with this question, it should have been about how regular bounding boxes were decided rather than anchor/prior boxes. So I am marking <code>@craq</code>'s answer as correct because that's how anchor boxes are decided according to the YOLO v2 paper</p>
  </blockquote>