def flip_predictions(predictions, shapes): flipped_preds = [] for pred, shape in zip(predictions, shapes): pred = menpo.shape.PointCloud(pred) pred = utils.mirror_landmarks_68(pred, shape) flipped_preds.append(pred.points) return np.array(flipped_preds, np.float32)
def flip_predictions(predictions, shapes): flipped_preds = [] for pred, shape in zip(predictions, shapes): pred = PointCloud(pred) if pred.points.shape[0] == 68: pred = utils.mirror_landmarks_68(pred, shape) elif pred.points.shape[0] == 73: pred = utils.mirror_landmarks_73(pred, shape) flipped_preds.append(pred.points) return np.array(flipped_preds, np.float32)