From 011a0987a7a2ef4e849f0a185fd18843a9d8bffb Mon Sep 17 00:00:00 2001 From: miawoltn Date: Sun, 11 Jun 2023 07:38:27 +0100 Subject: [PATCH] enhancement for deepface home path creation --- deepface/commons/functions.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/deepface/commons/functions.py b/deepface/commons/functions.py index 562e8162e..11eb2d8ec 100644 --- a/deepface/commons/functions.py +++ b/deepface/commons/functions.py @@ -36,13 +36,15 @@ def initialize_folder(): OSError: if the folder cannot be created. """ home = get_deepface_home() + deepFaceHomePath = home + "/.deepface" + weightsPath = deepFaceHomePath + "/weights" - if not os.path.exists(home + "/.deepface"): - os.makedirs(home + "/.deepface") + if not os.path.exists(deepFaceHomePath): + os.makedirs(deepFaceHomePath, exist_ok=True) print("Directory ", home, "/.deepface created") - if not os.path.exists(home + "/.deepface/weights"): - os.makedirs(home + "/.deepface/weights") + if not os.path.exists(weightsPath): + os.makedirs(weightsPath, exist_ok=True) print("Directory ", home, "/.deepface/weights created")