Next (#122)
* Clear VRAM of face analyser on post process * Mark as NEXT * Reduce tensorflow memory to 512 MB * Cosmetics on installer * Add is_download_done to pre_process() hook to prevent errors * Use latest onnxruntime * Testing for download methods, Make get_download_size more robust * Testing for download methods * Introduce --skip-download argument * Catch exception causes by a firewall * Looks stable to me
This commit is contained in:
@@ -4,7 +4,7 @@ import subprocess
|
||||
import pytest
|
||||
|
||||
import facefusion.globals
|
||||
from facefusion.utilities import conditional_download, extract_frames, create_temp, get_temp_directory_path, clear_temp, normalize_output_path, is_file, is_directory, is_image, is_video, encode_execution_providers, decode_execution_providers
|
||||
from facefusion.utilities import conditional_download, extract_frames, create_temp, get_temp_directory_path, clear_temp, normalize_output_path, is_file, is_directory, is_image, is_video, get_download_size, is_download_done, encode_execution_providers, decode_execution_providers
|
||||
|
||||
|
||||
@pytest.fixture(scope = 'module', autouse = True)
|
||||
@@ -140,6 +140,18 @@ def test_is_video() -> None:
|
||||
assert is_video('invalid') is False
|
||||
|
||||
|
||||
def test_get_download_size() -> None:
|
||||
assert get_download_size('https://github.com/facefusion/facefusion-assets/releases/download/examples/target-240p.mp4') == 191675
|
||||
assert get_download_size('https://github.com/facefusion/facefusion-assets/releases/download/examples/target-360p.mp4') == 370732
|
||||
assert get_download_size('invalid') is None
|
||||
|
||||
|
||||
def test_is_download_done() -> None:
|
||||
assert is_download_done('https://github.com/facefusion/facefusion-assets/releases/download/examples/target-240p.mp4', '.assets/examples/target-240p.mp4') is True
|
||||
assert is_download_done('https://github.com/facefusion/facefusion-assets/releases/download/examples/target-240p.mp4','invalid') is False
|
||||
assert is_download_done('invalid', 'invalid') is False
|
||||
|
||||
|
||||
def test_encode_execution_providers() -> None:
|
||||
assert encode_execution_providers([ 'CPUExecutionProvider' ]) == [ 'cpu' ]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user