@staticmethod
def nabs_process(obs, pred):
    """
        This function performs a origin shift operation by translating
        obs and pred so that the end-point of each trajectory in the obs
        variable is at the origin. This operation has been reported
        to improve the trajectory prediction result in the SR-LSTM paper.
        Note that this function should be applied only to the trajectories
        in the test set.

        :param obs: The observed part of the trajectories. Must be an
               Ntrajectories x Nobs_time_step x 2 numpy array.
        :param pred: The predicted part of the trajectories. Must be an
               Ntrajectories x Npred_time_step x 2 numpy array.
        :return obs_data, pred_data: the new trajectories of the same
                size.
        """
    last_obs_pts = obs[:, (-1), :].reshape(-1, 1, 2)
    obs_data = obs - last_obs_pts
    pred_data = pred - last_obs_pts
    return obs_data, pred_data
