code: def images_from_csv(
      train_filepath,
      image_column,
      label_columns=[],
      directory=None,
      suffix="",
      val_filepath=None,
      is_regression=False,
      target_size=(224, 224),
      color_mode="rgb",
      data_aug=None,
      val_pct=0.1,
      random_state=None,
  ):
      """
      ```
      Returns image generator (Iterator instance).
      Assumes output will be 2D one-hot-encoded labels for categorization.
      Note: This function preprocesses the input in preparation
            for a ResNet50 model.
  
      Args:
      train_filepath (string): path to training dataset in CSV format with header row
      image_column (string): name of column containing the filenames of images
                             If values in image_column do not have a file extension,
                             the extension should be supplied with suffix argument.
                             If values in image_column are not full file paths,
                             then the path to directory containing images should be supplied
                             as directory argument.
  
      label_columns(list or str): list or str representing the columns that store labels
                                  Labels can be in any one of the following formats:
                                  1. a single column string string (or integer) labels
  
                                     image_fname,label
                                     -----------------
                                     image01,cat
                                     image02,dog
  
                                  2. multiple columns for one-hot-encoded labels
                                     image_fname,cat,dog
                                     image01,1,0
                                     image02,0,1
  
                                  3. a single column of numeric values for image regression
                                     image_fname,age
                                     -----------------
                                     image01,68
                                     image02,18
  
      directory (string): path to directory containing images
                          not required if image_column contains full filepaths
      suffix(str): will be appended to each entry in image_column
                   Used when the filenames in image_column do not contain file extensions.
                   The extension in suffx should include ".".
      val_filepath (string): path to validation dataset in CSV format
      suffix(string): suffix to add to file names in image_column
      is_regression(bool): If True, task is treated as regression.
                           Used when there is single column of numeric values and
                           numeric values should be treated as numeric targets as opposed to class labels
      target_size (tuple):  image dimensions
      color_mode (string):  color mode
      data_aug(ImageDataGenerator):  a keras.preprocessing.image.ImageDataGenerator
                                    for data augmentation
      val_pct(float):  proportion of training data to be used for validation
                       only used if val_filepath is None
      random_state(int): random seed for train/test split
  
      Returns:
      batches: a tuple of two Iterators - one for train and one for test
      ```
      """
  
      # convert to dataframes
      train_df = pd.read_csv(train_filepath)
      val_df = None
      if val_filepath is not None:
          val_df = pd.read_csv(val_filepath)
  
      return images_from_df(
          train_df,
          image_column,
          label_columns=label_columns,
          directory=directory,
          suffix=suffix,
          val_df=val_df,
          is_regression=is_regression,
          target_size=target_size,
          color_mode=color_mode,
          data_aug=data_aug,
          val_pct=val_pct,
          random_state=random_state,
      )
  
imports: from ..None import utils
  from ..imports import *
  from .preprocessor import ImagePreprocessor
label_desc: Use image node_id 15 for calling a global function with example usage: images_from_csv(train_filepath, image_column, label_columns, directory, suffix, val_filepath, is_regression, target_size, color_mode, data_aug, val_pct, random_state) and returns: images_from_df