code: def Rt_from_6dof(pred_6dof):
      assert pred_6dof.ndim == 1 or pred_6dof.ndim == 2
      if pred_6dof.ndim == 1:
          R_pred = euler2matrix(pred_6dof[:3])
          t_pred = pred_6dof[-3:]
          return R_pred, t_pred
      else:
          R_pred = batch_euler2matrix(pred_6dof[:, :3])
          t_pred = pred_6dof[:, -3:].reshape(-1, 1, 3)
          return R_pred, t_pred
  
imports: import os
  import time
  import timm
  import glob
  import numpy
  import os.path
  import cv2
  import torch
  import torch.distributed
  from torch import nn
  from pathlib import Path
  from backbones import get_network
  from skimage import transform
  from scipy.spatial.transform import Rotation
label_desc: Use image node_id 3 for calling a global function with example usage: Rt_from_6dof(pred_6dof) and returns: R_pred,  t_pred, R_pred,  t_pred