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","."]
code: def __init__(self, transpose=True, data_format="tchw"):
      assert data_format in [
          "tchw",
          "cthw",
      ], "Target format must in ['tchw', 'cthw'], but got {data_format}"
      self.transpose = transpose
      self.data_format = data_format
  
imports: import cv2
  import numpy
  from PIL import Image
  import paddle
label_desc: Use image node_id 1 to create a new Image2Array object from inherited base classes: object with example: obj = Image2Array(transpose, data_format)