code: def compute_ate(gtruth_xyz, pred_xyz_o):
      # Make sure that the first matched frames align (no need for rotational alignment as
      # all the predicted/ground-truth snippets have been converted to use the same coordinate
      # system with the first frame of the snippet being the origin).
      offset = gtruth_xyz[0] - pred_xyz_o[0]
      pred_xyz = pred_xyz_o + offset[None, :]
  
      # Optimize the scaling factor
      scale = np.sum(gtruth_xyz * pred_xyz) / np.sum(pred_xyz**2)
      alignment_error = pred_xyz * scale - gtruth_xyz
      rmse = np.sqrt(np.sum(alignment_error**2)) / gtruth_xyz.shape[0]
      return rmse
  
file_path: gluon-cv/scripts/depth/test_pose.py
imports: from __future__ import absolute_import, division, print_function
  import os
  from tqdm import tqdm
  import numpy
  import mxnet
  from mxnet import gluon
  from gluoncv.data import KITTIOdomDataset
  from gluoncv.data.kitti.kitti_utils import dict_batchify_fn, readlines
  from gluoncv.model_zoo import get_model
  from gluoncv.model_zoo.monodepthv2 import *
  from gluoncv.model_zoo.monodepthv2.layers import transformation_from_parameters
  from options import MonodepthOptions
label_desc: Use image node_id 2 for calling a global function with example usage: compute_ate(gtruth_xyz, pred_xyz_o) and returns: rmse