code: def detect_depth(self, input_image: np.ndarray) -> np.ndarray:
      assert input_image.ndim == 3
      image_depth = input_image
      with torch.no_grad():
          image_depth = self.to_self(torch.from_numpy(image_depth))
          image_depth = image_depth / 127.5 - 1.0
          image_depth = (
              image_depth[None].permute(0, 3, 1, 2).contiguous()
          )
          depth = self.model(image_depth)[0]
  
          depth_pt = depth.clone()
          depth_pt -= torch.min(depth_pt)
          depth_pt /= torch.max(depth_pt)
          depth_image = depth_pt.cpu().numpy()
          depth_image = (
              (depth_image * 255.0).clip(0, 255).astype(np.uint8)
          )
  
          return depth_image
  
imports: import math
  import torch
  import numpy
  import torch.nn
  from torchvision.transforms import Compose
  from .core.dpt_depth import DPTDepthModel
  from .core.midas_net import MidasNet
  from .core.midas_net_custom import MidasNet_small
  from .core.transforms import Resize, NormalizeImage, PrepareForNet
  from .....misc.toolkit import download_model
label_desc: Use image node_id 5 for calling the MiDaSAPI obj's underlying member method code with example usage: obj.detect_depth(input_image) and returns: depth_image