(gt_bb, rp_bb)
return targets
Given ground truth bounding boxes and proposed boxes, compute the regresssion
    targets according to:

    t_x = (x_gt - x) / w
    t_y = (y_gt - y) / h
    t_w = log(w_gt / w)
    t_h = log(h_gt / h)

    where (x,y) are bounding box centers and (w,h) are the box dimensions
Given ground truth bounding boxes and proposed boxes, compute the regresssion
    targets according to:
Given ground truth bounding boxes and proposed boxes compute the regresssion targets according to :
def compute_targets(gt_bb, rp_bb):
    """
    Given ground truth bounding boxes and proposed boxes, compute the regresssion
    targets according to:

    t_x = (x_gt - x) / w
    t_y = (y_gt - y) / h
    t_w = log(w_gt / w)
    t_h = log(h_gt / h)

    where (x,y) are bounding box centers and (w,h) are the box dimensions
    """
    # calculate the region proposal centers and width/height
    (x, y, w, h) = _get_xywh(rp_bb)
    (x_gt, y_gt, w_gt, h_gt) = _get_xywh(gt_bb)

    # the target will be how to adjust the bbox's center and width/height
    # note that the targets are generated based on the original RP, which has not
    # been scaled by the image resizing
    targets_dx = (x_gt - x) / w
    targets_dy = (y_gt - y) / h
    targets_dw = np.log(w_gt / w)
    targets_dh = np.log(h_gt / h)

    targets = np.concatenate((targets_dx[:, np.newaxis],
                              targets_dy[:, np.newaxis],
                              targets_dw[:, np.newaxis],
                              targets_dh[:, np.newaxis],
                              ), axis=1)
    return targets
def compute_targets ( gt_bb , rp_bb ) : # calculate the region proposal centers and width/height ( x , y , w , h ) = _get_xywh ( rp_bb ) ( x_gt , y_gt , w_gt , h_gt ) = _get_xywh ( gt_bb ) # the target will be how to adjust the bbox's center and width/height # note that the targets are generated based on the original RP, which has not # been scaled by the image resizing targets_dx = ( x_gt - x ) / w targets_dy = ( y_gt - y ) / h targets_dw = np . log ( w_gt / w ) targets_dh = np . log ( h_gt / h ) targets = np . concatenate ( ( targets_dx [ : , np . newaxis ] , targets_dy [ : , np . newaxis ] , targets_dw [ : , np . newaxis ] , targets_dh [ : , np . newaxis ] , ) , axis = 1 ) return targets