classes package¶
Submodules¶
classes.auxiliary module¶
-
class
classes.auxiliary.
Auxiliary
(sizeX=100, sizeY=100, interpolation=2)[source]¶ Class that provides some auxiliary functions.
-
calcAccuracy
(recognizedImages, totalFaceImages)[source]¶ Calculates the accuracy (percentage) using the formula: acc = recognizedImages / totalFaceImages * 100 :param recognizedImages: The number of recognized face images. :param totalFaceImages: The number of total face images. :return: The accuracy.
-
concatenateImages
(leftImage, rightImage)[source]¶ Concatenate two images side by side (horizontally) and returns a new one. :param leftImage: The image that should be put to the left. :param rightImage: The image that should be put to the right. :return: The new concatenated image.
-
extractFilesPaths
(path)[source]¶ Extract all paths for all files type. :param path: The directory path. :return: A list with all paths for all files.
-
extractImagesPaths
(path)[source]¶ Extract all paths for each image in a directory. :param path: The directory path. :return: A list with all file paths.
-
getInterpolationMethodName
()[source]¶ Get the selected interpolation method name. :return: A string containing the interpolation method name.
-
isGrayscale
(image)[source]¶ Check if an image is in grayscale. :param image: The image. :return: True if the image is in grayscale.
-
loadAllImagesForTest
(testPath)[source]¶ Load all images for test. :param testPath: The test path. :return: Three lists with the images, labels and file names.
-
loadAllImagesForTrain
(trainPath)[source]¶ Load all images for training. :param trainPath: The train path. :return: Three lists with the images, labels and file names.
-
loadImage
(path)[source]¶ Load an image based on the path passed by parameter. :param path: The path to the image file. :return: The image object.
-
preprocessImage
(path)[source]¶ Preprocess an image. Load an image, convert to grayscale and resize it. :param path: The image path. :return: The preprocessed image.
-
resizeImage
(image, sizeX, sizeY, interpolationMethod)[source]¶ Resize an image. :param image: The image object. :param sizeX: The image width. :param sizeY: The image height. :param interpolationMethod: The interpolation method. :return: The resized image.
-
saveImage
(fileName, image)[source]¶ Save an image based on the fileName passed by parameter. :param fileName: The file name. :param image: The image.
-
setDefaultSize
(sizeX, sizeY)[source]¶ Set the default size. :param sizeX: Image width. :param sizeY: Image height.
-
classes.ensemble module¶
-
class
classes.ensemble.
Ensemble
(fralgorithms=[], auxiliary=<classes.auxiliary.Auxiliary instance>, voting=<classes.voting.Voting instance>)[source]¶ Class that provides an interface for the Ensemble
-
recognizeFaces
(testPath)[source]¶ Function that tries to recognize each face (path passed by parameter).
-
reset
()[source]¶ Reset all lists and results. It is used to reset all values to re-train the algorithm
-
classes.face_recognition module¶
-
class
classes.face_recognition.
FaceRecognition
(algorithm, auxiliary=<classes.auxiliary.Auxiliary instance>, threshold=-1)[source]¶ Class that provides an interface to the face recognition algorithms
classes.report module¶
-
class
classes.report.
Report
(object)[source]¶ Class that provides an interface to generate reports
-
generateFullReport
()[source]¶ Generate the full report. Return the content containing the information about each predicted image.
-
generateReportSummary
()[source]¶ Generate a report summary with informations about the test. Return the content as a string.
-