From 73e7d2183ac83f78dc3c1db987eceb93c5e1c3c2 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Mon, 2 May 2022 14:25:50 +0300 Subject: [PATCH] fix person path to folder --- image_classifier/image_classifier.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/image_classifier/image_classifier.py b/image_classifier/image_classifier.py index 1040abd..edf1e81 100755 --- a/image_classifier/image_classifier.py +++ b/image_classifier/image_classifier.py @@ -114,9 +114,9 @@ class image_classifier: os.makedirs(os.path.dirname(new_path)) if self.people_folder: for person in people: - person_path = os.path.join(self.people_folder, person, folder, filename) - if not os.path.exists(os.path.dirname(person_path)): - os.makedirs(os.path.dirname(person_path)) + person_path = os.path.join(self.people_folder, person, folder) + if not os.path.exists(person_path): + os.makedirs(person_path) self._log.debug(f"Copying file '{file}' to '{person_path}'...") shutil.copy(file, person_path) if not self.no_move: