Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,14 @@ import time
|
|
9 |
import gradio as gr
|
10 |
import sys
|
11 |
from PIL import Image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
# Set environment variables
|
14 |
os.environ["PIXEL3DMM_CODE_BASE"] = f"{os.getcwd()}"
|
@@ -19,8 +27,12 @@ def sh(cmd): subprocess.check_call(cmd, shell=True)
|
|
19 |
|
20 |
sh("pip install -e .")
|
21 |
|
|
|
|
|
|
|
22 |
from pixel3dmm import env_paths
|
23 |
|
|
|
24 |
sh("cd src/pixel3dmm/preprocessing/facer && pip install -e . && cd ../../../..")
|
25 |
sh("cd src/pixel3dmm/preprocessing/PIPNet/FaceBoxesV2/utils && sh make.sh && cd ../../../../../..")
|
26 |
|
|
|
9 |
import gradio as gr
|
10 |
import sys
|
11 |
from PIL import Image
|
12 |
+
import importlib, site, sys
|
13 |
+
|
14 |
+
# Re-discover all .pth/.egg-link files
|
15 |
+
for sitedir in site.getsitepackages():
|
16 |
+
site.addsitedir(sitedir)
|
17 |
+
|
18 |
+
# Clear caches so importlib will pick up new modules
|
19 |
+
importlib.invalidate_caches()
|
20 |
|
21 |
# Set environment variables
|
22 |
os.environ["PIXEL3DMM_CODE_BASE"] = f"{os.getcwd()}"
|
|
|
27 |
|
28 |
sh("pip install -e .")
|
29 |
|
30 |
+
# tell Python to re-scan site-packages now that the egg-link exists
|
31 |
+
import importlib, site; site.addsitedir(site.getsitepackages()[0]); importlib.invalidate_caches()
|
32 |
+
|
33 |
from pixel3dmm import env_paths
|
34 |
|
35 |
+
|
36 |
sh("cd src/pixel3dmm/preprocessing/facer && pip install -e . && cd ../../../..")
|
37 |
sh("cd src/pixel3dmm/preprocessing/PIPNet/FaceBoxesV2/utils && sh make.sh && cd ../../../../../..")
|
38 |
|