* Cli implementation of wav2lip

* - create get_first_item()
- remove non gan wav2lip model
- implement video memory strategy
- implement get_reference_frame()
- implement process_image()
- rearrange crop_mask_list
- implement test_cli
This commit is contained in:
Harisreedhar
2024-01-31 22:07:04 +05:30
committed by GitHub
parent b50f021743
commit 808460ae09
9 changed files with 271 additions and 12 deletions
+17
View File
@@ -10,6 +10,7 @@ def before_all() -> None:
conditional_download('.assets/examples',
[
'https://github.com/facefusion/facefusion-assets/releases/download/examples/source.jpg',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/source.mp3',
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-1080p.mp4'
])
subprocess.run([ 'ffmpeg', '-i', '.assets/examples/target-1080p.mp4', '-vframes', '1', '.assets/examples/target-1080p.jpg' ])
@@ -29,3 +30,19 @@ def test_image_to_video() -> None:
assert run.returncode == 0
assert 'video succeed' in run.stdout.decode()
def test_audio_to_video() -> None:
commands = [ sys.executable, 'run.py', '--frame-processors', 'lip_sync', '-s', '.assets/examples/source.mp3', '-t', '.assets/examples/target-1080p.mp4', '-o', '.assets/examples', '--trim-frame-end', '10', '--headless' ]
run = subprocess.run(commands, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
assert run.returncode == 0
assert 'video succeed' in run.stdout.decode()
def test_image_and_audio_to_video() -> None:
commands = [ sys.executable, 'run.py', '--frame-processors', 'lip_sync', 'face_swapper', '-s', '.assets/examples/source.mp3', '-s', '.assets/examples/source.jpg', '-t', '.assets/examples/target-1080p.mp4', '-o', '.assets/examples', '--trim-frame-end', '10', '--headless' ]
run = subprocess.run(commands, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
assert run.returncode == 0
assert 'video succeed' in run.stdout.decode()