code: def get_depth(points, pose):
      """Retruns depth from 3D points according to camera pose"""
      batch_size, num_samples, _ = points.shape
      if (
          pose.shape[1] == 7
      ):  # In case of quaternion vector representation
          cam_loc = pose[:, 4:]
          R = quat_to_rot(pose[:, :4])
          pose = (
              torch.eye(4)
              .unsqueeze(0)
              .repeat(batch_size, 1, 1)
              .cuda()
              .float()
          )
          pose[:, :3, 3] = cam_loc
          pose[:, :3, :3] = R
  
      points_hom = torch.cat(
          (points, torch.ones((batch_size, num_samples, 1)).cuda()),
          dim=2,
      )
  
      # permute for batch matrix product
      points_hom = points_hom.permute(0, 2, 1)
  
      points_cam = torch.inverse(pose).bmm(points_hom)
      depth = points_cam[:, 2, :][:, :, None]
      return depth
  
file_path: insightface/reconstruction/PBIDR/code/utils/rend_util.py
imports: import numpy
  import imageio
  import skimage
  import cv2
  import torch
  from torch.nn import functional
label_desc: Use image node_id 11 for calling a global function with example usage: get_depth(points, pose) and returns: depth