def compute_targets(gt_bb, rp_bb):
 (x, y, w, h) = _get_xywh(rp_bb)
 (x_gt, y_gt, w_gt, h_gt) = _get_xywh(gt_bb)
 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 ) : ( x , y , w , h ) = _get_xywh ( rp_bb ) ( x_gt , y_gt , w_gt , h_gt ) = _get_xywh ( gt_bb ) 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
given ground truth bounding boxes and proposed boxes .