Skip to content

Commit 011a098

Browse files
author
miawoltn
committed
enhancement for deepface home path creation
1 parent 3bf8bcb commit 011a098

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

deepface/commons/functions.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ def initialize_folder():
3636
OSError: if the folder cannot be created.
3737
"""
3838
home = get_deepface_home()
39+
deepFaceHomePath = home + "/.deepface"
40+
weightsPath = deepFaceHomePath + "/weights"
3941

40-
if not os.path.exists(home + "/.deepface"):
41-
os.makedirs(home + "/.deepface")
42+
if not os.path.exists(deepFaceHomePath):
43+
os.makedirs(deepFaceHomePath, exist_ok=True)
4244
print("Directory ", home, "/.deepface created")
4345

44-
if not os.path.exists(home + "/.deepface/weights"):
45-
os.makedirs(home + "/.deepface/weights")
46+
if not os.path.exists(weightsPath):
47+
os.makedirs(weightsPath, exist_ok=True)
4648
print("Directory ", home, "/.deepface/weights created")
4749

4850

0 commit comments

Comments
 (0)