def _compute_targets(ex_rois, gt_rois, labels):
 assert (ex_rois.shape[0] == gt_rois.shape[0])
 assert (ex_rois.shape[1] == 4)
 assert (gt_rois.shape[1] == 4)
 targets = bbox_transform(ex_rois, gt_rois)
 if BBOX_NORMALIZE_TARGETS_PRECOMPUTED:
  targets = ((targets - np.array(BBOX_NORMALIZE_MEANS)) / np.array(BBOX_NORMALIZE_STDS))
 return np.hstack((labels[:, np.newaxis], targets)).astype(np.float32, copy=False)

def _compute_targets ( ex_rois , gt_rois , labels ) : assert ( ex_rois . shape [ 0 ] == gt_rois . shape [ 0 ] ) assert ( ex_rois . shape [ 1 ] == 4 ) assert ( gt_rois . shape [ 1 ] == 4 ) targets = bbox_transform ( ex_rois , gt_rois ) if BBOX_NORMALIZE_TARGETS_PRECOMPUTED : targets = ( ( targets - np . array ( BBOX_NORMALIZE_MEANS ) ) / np . array ( BBOX_NORMALIZE_STDS ) ) return np . hstack ( ( labels [ : , np . newaxis ] , targets ) ) . astype ( np . float32 , copy = False )
compute bounding-box regression targets for an image .