code: def flow_from_bytes(content):
      """Read dense optical flow from bytes.
  
      .. note::
          This load optical flow function works for FlyingChairs, FlyingThings3D,
          Sintel, FlyingChairsOcc datasets, but cannot load the data from
          ChairsSDHom.
  
      Args:
          content (bytes): Optical flow bytes got from files or other streams.
  
      Returns:
          ndarray: Loaded optical flow with the shape (H, W, 2).
      """
  
      # header in first 4 bytes
      header = content[:4]
      if header.decode("utf-8") != "PIEH":
          raise Exception("Flow file header does not contain PIEH")
      # width in second 4 bytes
      width = np.frombuffer(content[4:], np.int32, 1).squeeze()
      # height in third 4 bytes
      height = np.frombuffer(content[8:], np.int32, 1).squeeze()
      # after first 12 bytes, all bytes are flow
      flow = np.frombuffer(
          content[12:], np.float32, width * height * 2
      ).reshape((height, width, 2))
  
      return flow
  
file_path: lavis/lavis/common/annotator/uniformer/mmcv/video/optflow.py
imports: import warnings
  import cv2
  import numpy
  from annotator.uniformer.mmcv.arraymisc import dequantize, quantize
  from annotator.uniformer.mmcv.image import imread, imwrite
  from annotator.uniformer.mmcv.utils import is_str
label_desc: Use image node_id 6 for calling a global function with example usage: flow_from_bytes(content) and returns: flow