code: def write_depth(path, depth, bits=1):
      """Write depth map to pfm and png file.
  
      Args:
          path (str): filepath without extension
          depth (array): depth
      """
      write_pfm(path + ".pfm", depth.astype(np.float32))
  
      depth_min = depth.min()
      depth_max = depth.max()
  
      max_val = (2 ** (8 * bits)) - 1
  
      if depth_max - depth_min > np.finfo("float").eps:
          out = max_val * (depth - depth_min) / (depth_max - depth_min)
      else:
          out = np.zeros(depth.shape, dtype=depth.type)
  
      if bits == 1:
          cv2.imwrite(path + ".png", out.astype("uint8"))
      elif bits == 2:
          cv2.imwrite(path + ".png", out.astype("uint16"))
  
      return
  
file_path: colossalai/examples/images/diffusion/ldm/modules/midas/utils.py
imports: import re
  import sys
  import cv2
  import numpy
  import torch
label_desc: Use image node_id 6 for calling a global function with example usage: write_depth(path, depth, bits) without return types