class_docstr: Compose preprocessing operators for obtaining prepocessed data. The shape of input image for all operations is [H, W, C], where H is the image height, W is the image width, and C is the number of image channels.
  
  Args:
      transforms(callmethod) : The method of preprocess images.
      to_rgb(bool): Whether to transform the input from BGR mode to RGB mode, default is False.
      channel_first(bool): whether to permute image from channel laste to channel first
class_docstr_tok: ["Compose","preprocessing","operators","for","obtaining","prepocessed","data",".","The","shape","of","input","image","for","all","operations","is","[","H",",","W",",","C","]",",","where","H","is","the","image","height",",","W","is","the","image","width",",","and","C","is","the","number","of","image","channels",".","Args",":","transforms","(","callmethod",")",":","The","method","of","preprocess","images",".","to_rgb","(","bool",")",":","Whether","to","transform","the","input","from","BGR","mode","to","RGB","mode",",","default","is","False",".","channel_first","(","bool",")",":","whether","to","permute","image","from","channel","laste","to","channel","first"]
code: def __call__(self, im: Union[np.ndarray, str]):
      if isinstance(im, str):
          im = cv2.imread(im).astype("float32")
  
      if im is None:
          raise ValueError("Can't read The image file {}!".format(im))
      if self.to_rgb:
          im = cv2.cvtColor(im, cv2.COLOR_BGR2RGB)
  
      for op in self.transforms:
          im = op(im)
  
      if self.channel_first:
          im = F.permute(im)
      return im
  
imports: import random
  from typing import Callable, Union, List, Tuple
  import cv2
  import PIL
  import numpy
  import paddlehub.vision.functional
label_desc: Use image node_id 2 for calling the Compose obj's underlying member method code with example usage: obj.__call__(im) and returns: im