Spaces:
Runtime error
Runtime error
File size: 634 Bytes
962014c ebc81de 5f091f6 3e49366 5f091f6 3e49366 5f091f6 60e78ea 298cb83 db34d9d ebc81de 298cb83 5f091f6 48c989c 5f091f6 298cb83 70518d9 6390cb6 70518d9 d677563 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import subprocess
import os
import torch
if torch.cuda.is_available():
device="cuda"
print("Using GPU")
else:
device="cpu"
print("Using CPU")
# Clone the repository
subprocess.run(["git", "clone", "https://github.com/Zebraslive/facefusion"], check=True)
# chande directory to face fusion to run ui
os.chdir("facefusion")
# installation
subprocess.run(["python", "install.py", "--onnxruntime", "cuda"], check=True)
# Run the ui
if device=="cuda":
subprocess.run(["python", "run.py", "--execution-providers", "cuda"], check=True)
else:
subprocess.run(["python", "run.py", "--execution-providers", "cpu"], check=True) |