From 7cf0b2d36ab0c232a5921ef448ca080430d1a24a Mon Sep 17 00:00:00 2001 From: henryruhs Date: Tue, 6 Oct 2026 17:44:57 +0200 Subject: [PATCH] pack resolution no longer does normalize --- facefusion/vision.py | 7 ++++--- tests/test_vision.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/facefusion/vision.py b/facefusion/vision.py index 031723ad..8b1b8eb4 100644 --- a/facefusion/vision.py +++ b/facefusion/vision.py @@ -67,7 +67,7 @@ def restrict_image_resolution(image_path : str, resolution : Resolution) -> Reso if is_image(image_path): image_resolution = detect_image_resolution(image_path) if image_resolution < resolution: - return image_resolution + return normalize_resolution(image_resolution) return resolution @@ -174,7 +174,7 @@ def restrict_video_resolution(video_path : str, resolution : Resolution) -> Reso if is_video(video_path): video_resolution = detect_video_resolution(video_path) if video_resolution < resolution: - return video_resolution + return normalize_resolution(video_resolution) return resolution @@ -190,12 +190,13 @@ def normalize_resolution(resolution : Tuple[float, float]) -> Resolution: if width > 0 and height > 0: normalize_width = round(width / 2) * 2 normalize_height = round(height / 2) * 2 + return normalize_width, normalize_height return 0, 0 def pack_resolution(resolution : Resolution) -> str: - width, height = normalize_resolution(resolution) + width, height = resolution return str(width) + 'x' + str(height) diff --git a/tests/test_vision.py b/tests/test_vision.py index 165c0473..7114f564 100644 --- a/tests/test_vision.py +++ b/tests/test_vision.py @@ -233,7 +233,7 @@ def test_normalize_resolution() -> None: def test_pack_resolution() -> None: - assert pack_resolution((1, 1)) == '0x0' + assert pack_resolution((1, 1)) == '1x1' assert pack_resolution((2, 2)) == '2x2'