class_docstr: transfer PIL.Image to Numpy array and transpose dimensions from 'dhwc' to 'dchw'.
  Args:
      transpose: whether to transpose or not, default True, False for slowfast.
class_docstr_tok: ["transfer","PIL.Image","to","Numpy","array","and","transpose","dimensions","from","'dhwc","'","to","'dchw","'",".","Args",":","transpose",":","whether","to","transpose","or","not",",","default","True",",","False","for","slowfast","."]
docstr: Performs Image to NumpyArray operations.
  Args:
      imgs: List where each item is a PIL.Image.
      For example, [PIL.Image0, PIL.Image1, PIL.Image2, ...]
  return:
      np_imgs: Numpy array.
docstr_tok: ["Performs","Image","to","NumpyArray","operations",".","Args",":","imgs",":","List","where","each","item","is","a","PIL.Image",".","For","example",",","[","PIL.Image0",",","PIL.Image1",",","PIL.Image2",",","...","]","return",":","np_imgs",":","Numpy","array","."]
code: def __call__(self, results):
      """
      Performs Image to NumpyArray operations.
      Args:
          imgs: List where each item is a PIL.Image.
          For example, [PIL.Image0, PIL.Image1, PIL.Image2, ...]
      return:
          np_imgs: Numpy array.
      """
      imgs = results["imgs"]
      if (
          "backend" in results and results["backend"] == "pyav"
      ):  # [T,H,W,C] in [0, 1]
          if self.transpose:
              if self.data_format == "tchw":
                  t_imgs = imgs.transpose((0, 3, 1, 2))  # tchw
              else:
                  t_imgs = imgs.transpose((3, 0, 1, 2))  # cthw
          results["imgs"] = t_imgs
      else:
          t_imgs = np.stack(imgs).astype("float32")
          if self.transpose:
              if self.data_format == "tchw":
                  t_imgs = t_imgs.transpose(0, 3, 1, 2)  # tchw
              else:
                  t_imgs = t_imgs.transpose(3, 0, 1, 2)  # cthw
          results["imgs"] = t_imgs
      return results
  
imports: import cv2
  import numpy
  from PIL import Image
  import paddle
label_desc: Use image node_id 2 for calling the Image2Array obj's underlying member method code with example usage: obj.__call__(results) and returns: results