Closed cs-heibao closed 5 years ago
@junjieAI In this place, first step, boxes[0:4] should be (xc, yc, w, h), xc and yc is the center point of the box. Second step, boxes[0:4] should be (x1, y1 , x2, y2), boxes[:, :2] has changed after boxes[:, :2] -= boxes[:, 2:] / 2
. You should check the code carefully whether i'm wrong.
@luuuyi Yes, I get it , it's right, thanks
@luuuyi def decode(loc, priors, variances): """Decode locations from predictions using priors to undo the encoding we did for offset regression at train time. Args: loc (tensor): location predictions for loc layers, Shape: [num_priors,4] priors (tensor): Prior boxes in center-offset form. Shape: [num_priors,4]. variances: (list[float]) Variances of priorboxes Return: decoded bounding box predictions """
here, we change the boxes format to (x1, y1, x2, y2), but the formula boxes[:, 2:] += boxes[:, :2] seems can not get the x2,y2