From 8cb899b9de055386ed5910920094c3443cf9c1f6 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Mon, 6 Sep 2021 16:05:04 +0300 Subject: [PATCH] Fix var name --- image_classifier/image_classifier.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/image_classifier/image_classifier.py b/image_classifier/image_classifier.py index 0755489..e1f30e3 100755 --- a/image_classifier/image_classifier.py +++ b/image_classifier/image_classifier.py @@ -43,14 +43,14 @@ class CustomFormatter(logging.Formatter): class image_classifier: - def __init__(self, debug_level, log_file, faces_folder, directory): + def __init__(self, debug_level, log_file, faces_directory, directory): ''' Initial function called when object is created ''' self.debug_level = debug_level if log_file is None: log_file = os.path.join(os.environ.get('HOME', os.environ.get('USERPROFILE', os.getcwd())), 'log', 'image_classifier.log') self.log_file = log_file self._init_log() - self.faces_folder = faces_folder + self.faces_directory = faces_directory self.directory = directory self.known_people = self.load_known_people() @@ -74,8 +74,8 @@ class image_classifier: def load_known_people(self): known_people = list() - if os.access(self.faces_folder, os.R_OK): - with os.scandir(self.faces_folder) as faces_items: + if os.access(self.faces_directory, os.R_OK): + with os.scandir(self.faces_directory) as faces_items: for entry in faces_items: if not entry.name.startswith('.') and entry.is_file(): person = dict() @@ -132,8 +132,8 @@ class image_classifier: @click.option("--faces-directory","-f", required=True, help="Folder containing the pictures that identify people. The filename would be used as the name for the person. Just one person per picture.") @click.option("--directory","-d", required=True, help="Folder containing the pictures to classify.") @click_config_file.configuration_option() -def __main__(debug_level, log_file, faces_folder, directory): - object = image_classifier(debug_level, log_file, faces_folder, directory) +def __main__(debug_level, log_file, faces_directory, directory): + object = image_classifier(debug_level, log_file, faces_directory, directory) if __name__ == "__main__": __main__()