code: def compute_metrics(
      xyz,
      xyz_target,
      feat,
      feat_target,
      T_gt,
      sym=False,
      tau_1=0.1,
      tau_2=0.05,
      rot_thresh=5,
      trans_thresh=5,
      use_ransac=False,
      ransac_thresh=0.02,
      use_teaser=False,
      noise_bound_teaser=0.1,
      registration_recall_thresh=0.2,
      xyz_gt=None,
      xyz_target_gt=None,
  ):
      """
      compute all the necessary metrics
      compute the hit ratio,
      compute the feat_match_ratio
  
      using fast global registration
      compute the translation error
      compute the rotation error
      compute rre, and compute the rte
  
      using ransac
      compute the translation error
      compute the rotation error
      compute rre, and compute the rte
  
      using Teaser++
      compute the translation error
      compute the rotation error
      compute rre, and compute the rtr
  
      Parameters
      ----------
  
      xyz: torch tensor of size N x 3
      xyz_target: torch tensor of size N x 3
  
      feat: torch tensor of size N x C
      feat_target: torch tensor of size N x C
  
  
      T_gt; 4 x 4 matrix
      """
  
      res = dict()
      t0 = time.time()
      matches_pred = get_matches(feat, feat_target, sym=sym)
      t1 = time.time()
      hit_ratio = compute_hit_ratio(
          xyz[matches_pred[:, 0]],
          xyz_target[matches_pred[:, 1]],
          T_gt,
          tau_1,
      )
      res["hit_ratio"] = hit_ratio.item()
      res["feat_match_ratio"] = float(hit_ratio.item() > tau_2)
      res["time_get_matches"] = t1 - t0
      # fast global registration
      t = time.time()
      T_fgr = fast_global_registration(
          xyz[matches_pred[:, 0]], xyz_target[matches_pred[:, 1]]
      )
      trans_error_fgr, rot_error_fgr = compute_transfo_error(
          T_fgr, T_gt
      )
      res["trans_error_fgr"] = trans_error_fgr.item()
      res["rot_error_fgr"] = rot_error_fgr.item()
      res["rre_fgr"] = float(rot_error_fgr.item() < rot_thresh)
      res["rte_fgr"] = float(trans_error_fgr.item() < trans_thresh)
      res["sr_fgr"] = compute_scaled_registration_error(
          xyz, T_gt, T_fgr
      ).item()
      res["time_fgr"] = time.time() - t
      if xyz_gt is not None and xyz_target_gt is not None:
          res["registration_recall_fgr"] = compute_registration_recall(
              xyz_gt, xyz_target_gt, T_fgr, registration_recall_thresh
          )
  
      # teaser pp
      if use_teaser:
          t = time.time()
          T_teaser = teaser_pp_registration(
              xyz[matches_pred[:, 0]],
              xyz_target[matches_pred[:, 1]],
              noise_bound=noise_bound_teaser,
          )
          trans_error_teaser, rot_error_teaser = compute_transfo_error(
              T_teaser, T_gt
          )
          res["trans_error_teaser"] = trans_error_teaser.item()
          res["rot_error_teaser"] = rot_error_teaser.item()
          res["rre_teaser"] = float(
              rot_error_teaser.item() < rot_thresh
          )
          res["rte_teaser"] = float(
              trans_error_teaser.item() < trans_thresh
          )
          res["sr_teaser"] = compute_scaled_registration_error(
              xyz, T_gt, T_teaser
          ).item()
          res["time_teaser"] = time.time() - t
          if xyz_gt is not None and xyz_target_gt is not None:
              res[
                  "registration_recall_teaser"
              ] = compute_registration_recall(
                  xyz_gt,
                  xyz_target_gt,
                  T_teaser,
                  registration_recall_thresh,
              )
  
      if use_ransac:
          raise NotImplementedError
  
      return res
  
imports: import copy
  import open3d
  import torch
  import hydra
  import logging
  from omegaconf import OmegaConf
  import os
  import os.path
  import sys
  import pandas
  import time
  from torch_points3d.models.model_factory import instantiate_model
  from torch_points3d.datasets.dataset_factory import instantiate_dataset, get_dataset_class
  from torch_points3d.models.base_model import BaseModel
  from torch_points3d.datasets.base_dataset import BaseDataset
  from torch_points3d.utils.registration import estimate_transfo, teaser_pp_registration, fast_global_registration, get_matches
  from torch_points3d.metrics.registration_metrics import compute_hit_ratio, compute_transfo_error, compute_scaled_registration_error, compute_registration_recall
  from torch_points3d.metrics.colored_tqdm import Coloredtqdm
  from torch_points3d.metrics.model_checkpoint import ModelCheckpoint
label_desc: Use image node_id 1 for calling a global function with example usage: compute_metrics(xyz, xyz_target, feat, feat_target, T_gt, sym, tau_1, tau_2, rot_thresh, trans_thresh, use_ransac, ransac_thresh, use_teaser, noise_bound_teaser, registration_recall_thresh, xyz_gt, xyz_target_gt) and returns: res