(models)
return X_train, X_test, input_shape[0], input_shape[1], num_classes
function to get image data from a certain folder specifically for CNN tuning.
    Assumes CNN query has already been called.
    :param data_path: represents the location of the two training/testing folders.
    :param read_mode: represents the type of reading it does: setwise, pathwise, or classwise
    :param training_ratio: represents the size of the training / testing set.
function to get image data from a certain folder specifically for CNN tuning.
    Assumes CNN query has already been called.
    :param data_path: represents the location of the two training/testing folders.
    :param read_mode: represents the type of reading it does: setwise, pathwise, or classwise
    :param training_ratio: represents the size of the training / testing set.
function to get image data from a certain folder specifically for CNN tuning . Assumes CNN query has already been called . : param data_path : represents the location of the two training / testing folders . : param read_mode : represents the type of reading it does : setwise pathwise or classwise : param training_ratio : represents the size of the training / testing set .
def get_image_data(models):
    '''
    function to get image data from a certain folder specifically for CNN tuning.
    Assumes CNN query has already been called.
    :param data_path: represents the location of the two training/testing folders.
    :param read_mode: represents the type of reading it does: setwise, pathwise, or classwise
    :param training_ratio: represents the size of the training / testing set.
    '''
    training_path = "/proc_training_set"
    testing_path = "/proc_testing_set"

    # read_type = set_distinguisher(data_path, read_mode)['read_mode']

    input_shape = models['convolutional_NN']['shape']
    input_single = (input_shape[0], input_shape[1])
    num_classes = models['convolutional_NN']['num_classes']
    loss_func = ""
    data_path = models['convolutional_NN']['data_path']

    if num_classes > 2:
        loss_func = "categorical_crossentropy"
    elif num_classes == 2:
        loss_func = "binary_crossentropy"

    train_data = ImageDataGenerator(rescale=1. / 255,
                                    shear_range=0.2,
                                    zoom_range=0.2,
                                    horizontal_flip=True)
    test_data = ImageDataGenerator(rescale=1. / 255)

    X_train = train_data.flow_from_directory(data_path + training_path,
                                             target_size=input_single,
                                             color_mode='rgb',
                                             batch_size=(32 if models['convolutional_NN']['data_sizes']['train_size'] >= 32 else 1),
                                             class_mode=loss_func[:loss_func.find("_")]
                                             )
    X_test = test_data.flow_from_directory(data_path + testing_path,
                                           target_size=input_single,
                                           color_mode='rgb',
                                           batch_size=(32 if models['convolutional_NN']['data_sizes']['test_size'] >= 32 else 1),
                                           class_mode=loss_func[:loss_func.find("_")])

    return X_train, X_test, input_shape[0], input_shape[1], num_classes
def get_image_data ( models ) : training_path = "/proc_training_set" testing_path = "/proc_testing_set" # read_type = set_distinguisher(data_path, read_mode)['read_mode'] input_shape = models [ 'convolutional_NN' ] [ 'shape' ] input_single = ( input_shape [ 0 ] , input_shape [ 1 ] ) num_classes = models [ 'convolutional_NN' ] [ 'num_classes' ] loss_func = "" data_path = models [ 'convolutional_NN' ] [ 'data_path' ] if num_classes > 2 : loss_func = "categorical_crossentropy" elif num_classes == 2 : loss_func = "binary_crossentropy" train_data = ImageDataGenerator ( rescale = 1. / 255 , shear_range = 0.2 , zoom_range = 0.2 , horizontal_flip = True ) test_data = ImageDataGenerator ( rescale = 1. / 255 ) X_train = train_data . flow_from_directory ( data_path + training_path , target_size = input_single , color_mode = 'rgb' , batch_size = ( 32 if models [ 'convolutional_NN' ] [ 'data_sizes' ] [ 'train_size' ] >= 32 else 1 ) , class_mode = loss_func [ : loss_func . find ( "_" ) ] ) X_test = test_data . flow_from_directory ( data_path + testing_path , target_size = input_single , color_mode = 'rgb' , batch_size = ( 32 if models [ 'convolutional_NN' ] [ 'data_sizes' ] [ 'test_size' ] >= 32 else 1 ) , class_mode = loss_func [ : loss_func . find ( "_" ) ] ) return X_train , X_test , input_shape [ 0 ] , input_shape [ 1 ] , num_classes