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