mirror of
https://github.com/facefusion/facefusion.git
synced 2026-07-25 19:41:08 +02:00
add todo
add test cleanup remove -w move --workflow position fix test add --worflow, audio-to-image, image-to-image, image-to-video
This commit is contained in:
+8
-18
@@ -3,7 +3,7 @@ import subprocess
|
||||
import pytest
|
||||
|
||||
from facefusion.download import conditional_download
|
||||
from facefusion.vision import calculate_histogram_difference, count_trim_frame_total, count_video_frame_total, detect_image_resolution, detect_video_duration, detect_video_fps, detect_video_resolution, match_frame_color, normalize_resolution, pack_resolution, predict_video_frame_total, read_image, read_video_frame, restrict_image_resolution, restrict_trim_frame, restrict_video_fps, restrict_video_resolution, scale_resolution, unpack_resolution, write_image
|
||||
from facefusion.vision import calculate_histogram_difference, count_video_frame_total, detect_image_resolution, detect_video_duration, detect_video_fps, detect_video_resolution, match_frame_color, normalize_resolution, pack_resolution, predict_video_frame_total, read_image, read_video_frame, restrict_image_resolution, restrict_trim_video_frame, restrict_video_fps, restrict_video_resolution, scale_resolution, unpack_resolution, write_image
|
||||
from .helper import get_test_example_file, get_test_examples_directory, get_test_output_file, prepare_test_output_directory
|
||||
|
||||
|
||||
@@ -97,24 +97,14 @@ def test_detect_video_duration() -> None:
|
||||
assert detect_video_duration('invalid') == 0
|
||||
|
||||
|
||||
def test_count_trim_frame_total() -> None:
|
||||
assert count_trim_frame_total(get_test_example_file('target-240p.mp4'), 0, 200) == 200
|
||||
assert count_trim_frame_total(get_test_example_file('target-240p.mp4'), 70, 270) == 200
|
||||
assert count_trim_frame_total(get_test_example_file('target-240p.mp4'), -10, None) == 270
|
||||
assert count_trim_frame_total(get_test_example_file('target-240p.mp4'), None, -10) == 0
|
||||
assert count_trim_frame_total(get_test_example_file('target-240p.mp4'), 280, None) == 0
|
||||
assert count_trim_frame_total(get_test_example_file('target-240p.mp4'), None, 280) == 270
|
||||
assert count_trim_frame_total(get_test_example_file('target-240p.mp4'), None, None) == 270
|
||||
|
||||
|
||||
def test_restrict_trim_frame() -> None:
|
||||
assert restrict_trim_frame(get_test_example_file('target-240p.mp4'), 0, 200) == (0, 200)
|
||||
assert restrict_trim_frame(get_test_example_file('target-240p.mp4'), 70, 270) == (70, 270)
|
||||
assert restrict_trim_frame(get_test_example_file('target-240p.mp4'), -10, None) == (0, 270)
|
||||
assert restrict_trim_frame(get_test_example_file('target-240p.mp4'), None, -10) == (0, 0)
|
||||
assert restrict_trim_frame(get_test_example_file('target-240p.mp4'), 280, None) == (270, 270)
|
||||
assert restrict_trim_frame(get_test_example_file('target-240p.mp4'), None, 280) == (0, 270)
|
||||
assert restrict_trim_frame(get_test_example_file('target-240p.mp4'), None, None) == (0, 270)
|
||||
assert restrict_trim_video_frame(get_test_example_file('target-240p.mp4'), 0, 200) == (0, 200)
|
||||
assert restrict_trim_video_frame(get_test_example_file('target-240p.mp4'), 70, 270) == (70, 270)
|
||||
assert restrict_trim_video_frame(get_test_example_file('target-240p.mp4'), -10, None) == (0, 270)
|
||||
assert restrict_trim_video_frame(get_test_example_file('target-240p.mp4'), None, -10) == (0, 0)
|
||||
assert restrict_trim_video_frame(get_test_example_file('target-240p.mp4'), 280, None) == (270, 270)
|
||||
assert restrict_trim_video_frame(get_test_example_file('target-240p.mp4'), None, 280) == (0, 270)
|
||||
assert restrict_trim_video_frame(get_test_example_file('target-240p.mp4'), None, None) == (0, 270)
|
||||
|
||||
|
||||
def test_detect_video_resolution() -> None:
|
||||
|
||||
Reference in New Issue
Block a user