|
import subprocess |
|
import os |
|
import torch |
|
|
|
if torch.cuda.is_available(): |
|
device="cuda" |
|
print("Using GPU") |
|
else: |
|
device="cpu" |
|
print("Using CPU") |
|
|
|
|
|
subprocess.run(["git", "clone", "https://github.com/dark2star/facefusion", "--branch", "pre", "--single-branch"], check=True) |
|
|
|
os.chdir("facefusion") |
|
|
|
|
|
subprocess.run(["python", "install.py", "--onnxruntime", "cuda-11.8", "--skip-conda"], check=True) |
|
|
|
|
|
if device=="cuda": |
|
subprocess.run(["python", "run.py", "--execution-providers", "cpu", "cuda"], check=True) |
|
else: |
|
subprocess.run(["python", "run.py", "--execution-providers", "cpu"], check=True) |