danicor commited on
Commit
5a46c95
·
verified ·
1 Parent(s): ecdc7a9

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from huggingface_hub import hf_hub_download
3
+
4
+ # مسیر CelebAMask-HQ
5
+ celeb_path = "/home/user/CelebAMask-HQ"
6
+ face_parsing_path = os.path.join(celeb_path, "face_parsing")
7
+
8
+ print("[Info] PYTHONPATH:", os.environ.get("PYTHONPATH"))
9
+ print("[Info] CelebAMask-HQ path exists:", os.path.exists(celeb_path))
10
+ print("[Info] face_parsing folder exists:", os.path.exists(face_parsing_path))
11
+
12
+ # دانلود مدل از Hugging Face (اگر موجود نیست)
13
+ model_path = hf_hub_download(
14
+ repo_id="public-data/CelebAMask-HQ-Face-Parsing",
15
+ filename="models/model.pth",
16
+ cache_dir="./huggingface_models"
17
+ )
18
+
19
+ print("[Info] Model downloaded to:", model_path)