Fix/extrating merging progress bar total (#868)
* Introduce predict_video_frame_total() to fix progress bar while extracting and merging * Introduce predict_video_frame_total() to fix progress bar while extracting and merging * Use floor over ceil
This commit is contained in:
@@ -3,7 +3,7 @@ import subprocess
|
||||
import pytest
|
||||
|
||||
from facefusion.download import conditional_download
|
||||
from facefusion.vision import calc_histogram_difference, count_trim_frame_total, count_video_frame_total, create_image_resolutions, create_video_resolutions, detect_image_resolution, detect_video_duration, detect_video_fps, detect_video_resolution, match_frame_color, normalize_resolution, pack_resolution, read_image, read_video_frame, restrict_image_resolution, restrict_trim_frame, restrict_video_fps, restrict_video_resolution, unpack_resolution, write_image
|
||||
from facefusion.vision import calc_histogram_difference, count_trim_frame_total, count_video_frame_total, create_image_resolutions, create_video_resolutions, 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, unpack_resolution, write_image
|
||||
from .helper import get_test_example_file, get_test_examples_directory, get_test_output_file, prepare_test_output_directory
|
||||
|
||||
|
||||
@@ -80,6 +80,13 @@ def test_count_video_frame_total() -> None:
|
||||
assert count_video_frame_total('invalid') == 0
|
||||
|
||||
|
||||
def test_predict_video_frame_total() -> None:
|
||||
assert predict_video_frame_total(get_test_example_file('target-240p-25fps.mp4'), 12.5, 0, 100) == 50
|
||||
assert predict_video_frame_total(get_test_example_file('target-240p-25fps.mp4'), 25, 0, 100) == 100
|
||||
assert predict_video_frame_total(get_test_example_file('target-240p-25fps.mp4'), 25, 0, 200) == 200
|
||||
assert predict_video_frame_total('invalid', 25, 0, 100) == 0
|
||||
|
||||
|
||||
def test_detect_video_fps() -> None:
|
||||
assert detect_video_fps(get_test_example_file('target-240p-25fps.mp4')) == 25.0
|
||||
assert detect_video_fps(get_test_example_file('target-240p-30fps.mp4')) == 30.0
|
||||
|
||||
Reference in New Issue
Block a user