mirror of
https://github.com/finegrain-ai/refiners.git
synced 2024-11-14 00:58:13 +00:00
add test_multi_upscaler_small to check that MultiUpscaler works with small (16x16px) images
This commit is contained in:
parent
7b6f97347e
commit
f89c4f720d
|
@ -2675,6 +2675,16 @@ def test_multi_upscaler(
|
||||||
ensure_similar_images(predicted_image, expected_multi_upscaler, min_psnr=35, min_ssim=0.99)
|
ensure_similar_images(predicted_image, expected_multi_upscaler, min_psnr=35, min_ssim=0.99)
|
||||||
|
|
||||||
|
|
||||||
|
@no_grad()
|
||||||
|
def test_multi_upscaler_small(
|
||||||
|
multi_upscaler: MultiUpscaler,
|
||||||
|
clarity_example: Image.Image,
|
||||||
|
) -> None:
|
||||||
|
image = clarity_example.resize((16, 16))
|
||||||
|
image = multi_upscaler.upscale(image) # check we can upscale a small image
|
||||||
|
image = multi_upscaler.upscale(image) # check we can upscale it twice
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
def expected_ic_light(ref_path: Path) -> Image.Image:
|
def expected_ic_light(ref_path: Path) -> Image.Image:
|
||||||
return _img_open(ref_path / "expected_ic_light.png").convert("RGB")
|
return _img_open(ref_path / "expected_ic_light.png").convert("RGB")
|
||||||
|
|
Loading…
Reference in a new issue