hoda.fakhar commited on
Commit
a01d457
·
1 Parent(s): 5ff59cc

Fix permission error: switch from /app to /home/user in build script

Browse files
Files changed (1) hide show
  1. scripts/build_models.py +3 -2
scripts/build_models.py CHANGED
@@ -8,8 +8,9 @@ import os
8
  import sys
9
  from concurrent.futures import ThreadPoolExecutor, TimeoutError as FuturesTimeout
10
 
11
- os.environ["DEEPFACE_HOME"] = "/app"
12
- WEIGHTS_DIR = "/app/.deepface/weights"
 
13
  os.makedirs(WEIGHTS_DIR, exist_ok=True)
14
 
15
  HF_REPO = "Hodfa71/deepface-weights"
 
8
  import sys
9
  from concurrent.futures import ThreadPoolExecutor, TimeoutError as FuturesTimeout
10
 
11
+ # Use DEEPFACE_HOME from env (set in Dockerfile) or fallback to user home
12
+ DEEPFACE_HOME = os.environ.get("DEEPFACE_HOME", os.path.expanduser("~"))
13
+ WEIGHTS_DIR = os.path.join(DEEPFACE_HOME, ".deepface", "weights")
14
  os.makedirs(WEIGHTS_DIR, exist_ok=True)
15
 
16
  HF_REPO = "Hodfa71/deepface-weights"