class_docstr: Produce images read from a list of files as (h, w, c) arrays. 
docstr: Args:
      files (list): list of file paths.
      channel (int): 1 or 3. Will convert grayscale to RGB images if channel==3.
          Will produce (h, w, 1) array if channel==1.
      resize (tuple): int or (h, w) tuple. If given, resize the image.
docstr_tok: ["Args",":","files","(","list",")",":","list","of","file","paths",".","channel","(","int",")",":","1","or","3",".","Will","convert","grayscale","to","RGB","images","if","channel==3",".","Will","produce","(","h",",","w",",","1",")","array","if","channel==1",".","resize","(","tuple",")",":","int","or","(","h",",","w",")","tuple",".","If","given",",","resize","the","image","."]
code: def __init__(self, files, channel=3, resize=None, shuffle=False):
      """
      Args:
          files (list): list of file paths.
          channel (int): 1 or 3. Will convert grayscale to RGB images if channel==3.
              Will produce (h, w, 1) array if channel==1.
          resize (tuple): int or (h, w) tuple. If given, resize the image.
      """
      assert len(files), "No image files given to ImageFromFile!"
      self.files = files
      self.channel = int(channel)
      assert self.channel in [1, 3], self.channel
      self.imread_mode = (
          cv2.IMREAD_GRAYSCALE
          if self.channel == 1
          else cv2.IMREAD_COLOR
      )
      if resize is not None:
          resize = shape2d(resize)
      self.resize = resize
      self.shuffle = shuffle
  
imports: import copy
  import numpy
  from contextlib import contextmanager
  from ..utils import logger
  from ..utils.argtools import shape2d
  from .base import RNGDataFlow
  from .common import MapData, MapDataComponent
label_desc: Use image node_id 1 to create a new ImageFromFile object from inherited base classes: RNGDataFlow with example: obj = ImageFromFile(files, channel, resize, shuffle)