pytorch-retinanet icon indicating copy to clipboard operation
pytorch-retinanet copied to clipboard

Few things to understand

Open jaideep11061982 opened this issue 6 years ago • 2 comments

hi yhenon Thanks for providing in the implementation. I have below things to understand from you...

  1. in Losses .py file why are we subtracting from width & height anchor[:,0] & anchor [:,1] respectively i think we initi anchors 0,1 columns to zero anchor = anchors[0, :, :]

     anchor_widths  = anchor[:, 2] - anchor[:, 0]
     anchor_heights = anchor[:, 3] - anchor[:, 1]
    
  2. what does anchor ctr_X denoes ,why we use 0.5 here anchor_ctr_x = anchor[:, 0] + 0.5 * anchor_widths anchor_ctr_y = anchor[:, 1] + 0.5 * anchor_heights

  3. what is the purpose of shifted anchors in model.py. shifted_anchors = shift(image_shapes[idx], self.strides[idx], anchors) all_anchors = np.append(all_anchors, shifted_anchors, axis=0)

  4. In general does x and y cordinates in bbox vector [pc,x,y,h,w...] deonotes top left corner cordinates ?

jaideep11061982 avatar May 21 '19 17:05 jaideep11061982

  1. In general does x and y cordinates in bbox vector [pc,x,y,h,w...] deonotes top left corner cordinates ?

This is just convention. When x/y are top denote top left corner, it's easy to find the extent of the bounding box using height and width.

  1. what does anchor ctr_X denoes ,why we use 0.5 here

It denotes center_x (ctr_x). If you take the x-coordinate of the top left corner and add half the width (then do the same for y), you get the center of the anchor box.

  1. why are we subtracting from width & height anchor[:,0] & anchor [:,1] respectively i think we initi anchors 0,1 columns to zero

I haven't actually checked, but I'm fairly sure anchor[:, 2] is x2, anchor[:, 0] is x1. So x2-x1 is the width of the anchor box.

MikkelAntonsen avatar Jun 25 '19 07:06 MikkelAntonsen

@jaideep11061982 please close this issue if @MikkelAntonsen answer clears your doubts.

DecentMakeover avatar Feb 01 '20 09:02 DecentMakeover