Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,25 +21,4 @@ def sh(cmd): subprocess.check_call(cmd, shell=True)
|
|
| 21 |
sh("pip install -e .")
|
| 22 |
sh("cd src/pixel3dmm/preprocessing/facer && pip install -e .")
|
| 23 |
sh("cd src/pixel3dmm/preprocessing/PIPNet/FaceBoxesV2/utils && sh make.sh")
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
def install_cuda_toolkit():
|
| 27 |
-
CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda_12.1.0_530.30.02_linux.run"
|
| 28 |
-
CUDA_TOOLKIT_FILE = "/tmp/%s" % os.path.basename(CUDA_TOOLKIT_URL)
|
| 29 |
-
subprocess.call(["wget", "-q", CUDA_TOOLKIT_URL, "-O", CUDA_TOOLKIT_FILE])
|
| 30 |
-
subprocess.call(["chmod", "+x", CUDA_TOOLKIT_FILE])
|
| 31 |
-
subprocess.call([CUDA_TOOLKIT_FILE, "--silent", "--toolkit"])
|
| 32 |
-
|
| 33 |
-
os.environ["CUDA_HOME"] = "/usr/local/cuda"
|
| 34 |
-
os.environ["PATH"] = "%s/bin:%s" % (os.environ["CUDA_HOME"], os.environ["PATH"])
|
| 35 |
-
os.environ["LD_LIBRARY_PATH"] = "%s/lib:%s" % (
|
| 36 |
-
os.environ["CUDA_HOME"],
|
| 37 |
-
"" if "LD_LIBRARY_PATH" not in os.environ else os.environ["LD_LIBRARY_PATH"],
|
| 38 |
-
)
|
| 39 |
-
# Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
|
| 40 |
-
os.environ["TORCH_CUDA_ARCH_LIST"] = "9.0"
|
| 41 |
-
print("==> finished installation")
|
| 42 |
-
|
| 43 |
-
install_cuda_toolkit()
|
| 44 |
-
|
| 45 |
sh("python app_photo.py")
|
|
|
|
| 21 |
sh("pip install -e .")
|
| 22 |
sh("cd src/pixel3dmm/preprocessing/facer && pip install -e .")
|
| 23 |
sh("cd src/pixel3dmm/preprocessing/PIPNet/FaceBoxesV2/utils && sh make.sh")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
sh("python app_photo.py")
|