mirror of
https://github.com/facefusion/facefusion.git
synced 2026-05-26 23:52:25 +02:00
Enable venv on the fly
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
if __name__ == '__main__':
|
||||
if 'venv' in sys.executable or 'conda' in sys.executable:
|
||||
if 'venv' in sys.executable or '--skip-venv' in sys.argv:
|
||||
from facefusion import core
|
||||
|
||||
core.cli()
|
||||
else:
|
||||
try:
|
||||
subprocess.run([ 'venv/bin/python', 'run.py' ])
|
||||
except KeyboardInterrupt:
|
||||
except:
|
||||
sys.exit()
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ def before_all() -> None:
|
||||
|
||||
|
||||
def test_image_to_image() -> None:
|
||||
commands = [ sys.executable, 'run.py', '-s', '.assets/examples/source.jpg', '-t', '.assets/examples/target-1080p.jpg', '-o', '.assets/examples', '--headless' ]
|
||||
commands = [ sys.executable, 'run.py', '-s', '.assets/examples/source.jpg', '-t', '.assets/examples/target-1080p.jpg', '-o', '.assets/examples', '--headless', '--skip-venv' ]
|
||||
run = subprocess.run(commands, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
|
||||
|
||||
assert run.returncode == 0
|
||||
@@ -24,7 +24,7 @@ def test_image_to_image() -> None:
|
||||
|
||||
|
||||
def test_image_to_video() -> None:
|
||||
commands = [ sys.executable, 'run.py', '-s', '.assets/examples/source.jpg', '-t', '.assets/examples/target-1080p.mp4', '-o', '.assets/examples', '--trim-frame-end', '10', '--headless' ]
|
||||
commands = [ sys.executable, 'run.py', '-s', '.assets/examples/source.jpg', '-t', '.assets/examples/target-1080p.mp4', '-o', '.assets/examples', '--trim-frame-end', '10', '--headless', '--skip-venv' ]
|
||||
run = subprocess.run(commands, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
|
||||
|
||||
assert run.returncode == 0
|
||||
|
||||
Reference in New Issue
Block a user