code: def read_pfm(path):
      """Read pfm file.
  
      Args:
          path (str): path to file
  
      Returns:
          tuple: (data, scale)
      """
      with open(path, "rb") as file:
          color = None
          width = None
          height = None
          scale = None
          endian = None
  
          header = file.readline().rstrip()
          if header.decode("ascii") == "PF":
              color = True
          elif header.decode("ascii") == "Pf":
              color = False
          else:
              raise Exception("Not a PFM file: " + path)
  
          dim_match = re.match(
              r"^(\d+)\s(\d+)\s$", file.readline().decode("ascii")
          )
          if dim_match:
              width, height = list(map(int, dim_match.groups()))
          else:
              raise Exception("Malformed PFM header.")
  
          scale = float(file.readline().decode("ascii").rstrip())
          if scale < 0:
              # little-endian
              endian = "<"
              scale = -scale
          else:
              # big-endian
              endian = ">"
  
          data = np.fromfile(file, endian + "f")
          shape = (height, width, 3) if color else (height, width)
  
          data = np.reshape(data, shape)
          data = np.flipud(data)
  
          return data, scale
  
file_path: StableDiffusion/ldm/modules/midas/utils.py
imports: import sys
  import re
  import numpy
  import cv2
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: read_pfm(path) and returns: data,  scale