def _compute_targets(ex_rois, gt_rois): """ compute bbox targets for an image """ assert ex_rois.shape[0] == gt_rois.shape[0] assert ex_rois.shape[1] == 4 assert gt_rois.shape[1] == 5 return bbox_transform(ex_rois, gt_rois[:, :4]).astype(np.float32, copy=False)
def _compute_targets(ex_rois, gt_rois, labels): """Compute bounding-box regression targets for an image.""" 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 config.TRAIN.BBOX_NORMALIZATION_PRECOMPUTED: # Optionally normalize targets by a precomputed mean and stdev targets = ((targets - np.array(config.TRAIN.BBOX_MEANS)) / np.array(config.TRAIN.BBOX_STDS)) return np.hstack( (labels[:, np.newaxis], targets)).astype(np.float32, copy=False)
def _compute_targets(ex_rois, gt_rois, labels): """Compute bounding-box regression targets for an image.""" 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 config.TRAIN.BBOX_NORMALIZATION_PRECOMPUTED: # Optionally normalize targets by a precomputed mean and stdev targets = ((targets - np.array(config.TRAIN.BBOX_MEANS)) / np.array(config.TRAIN.BBOX_STDS)) return np.hstack((labels[:, np.newaxis], targets)).astype(np.float32, copy=False)