loader module

class loader.Loader(parser, config)[source]

Read in HDF5 files from train and test directory and perform some checks to make sure everything is okay.

Parameters
parser (argparse object): Command line arguments handled by argparse.
config (dict): Dictionary of configuration which was made from YAML.

Methods

getImageCountsPerFile()

Returns

getMax()

Returns

getMin()

Returns

getTestingFiles()

Returns

getTestingH5Files()

Returns

getTotalImages()

Returns

getTrainingFiles()

Returns

getTrainingH5Files()

Returns

getXShape()

Returns

getYShape()

Returns

prepareData(files[, test])

Check the shapes across all data sets to make sure all is good.

readDir(dir_name)

Read all files in a directory.

getImageCountsPerFile()[source]
Returns
A dict with training filenames as keys and number of images as values.
getMax()[source]
Returns
The maximim value of training and testing.
getMin()[source]
Returns
The minimum value of training and testing.
getTestingFiles()[source]
Returns
The list of testing filenames.
getTestingH5Files()[source]
Returns
The list of testing h5py file objects.
getTotalImages()[source]
Returns
The total number of images used in training.
getTrainingFiles()[source]
Returns
The list of training filenames.
getTrainingH5Files()[source]
Returns
The list of training h5py file objects.
getXShape()[source]
Returns
The shape of the input data.
getYShape()[source]
Returns
The shape of the output data.
prepareData(files, test=False)[source]

Check the shapes across all data sets to make sure all is good.

Parameters
files (list): list of files to check.
test (bool): Set to true if they are testing files. Default: False.
Returns
A list of h5py file objects.
readDir(dir_name)[source]

Read all files in a directory. This is called in the __init__ function.

Parameters
dir_name (str): Path in which files will be collected.
Returns
A list of files in the supplied path.