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:
harisreedhar
2025-11-24 21:51:52 +05:30
committed by henryruhs
parent 6180ccf6e6
commit d4a4cf71d4
27 changed files with 329 additions and 107 deletions
+8 -18
View File
@@ -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: