Skip to content

Commit

Permalink
fix(tests): make release tests more strict, update DEIS reference
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Mar 9, 2023
1 parent 312d8d2 commit 3d0f243
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions api/scripts/test-refs/txt2img-sd-v1-5-512-muffin-deis-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions api/scripts/test-release.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(
name: str,
query: str,
max_attempts: int = FAST_TEST,
mse_threshold: float = 0.001,
mse_threshold: float = 1e-4,
source: Union[Image.Image, List[Image.Image]] = None,
mask: Image.Image = None,
) -> None:
Expand Down Expand Up @@ -86,6 +86,7 @@ def __init__(
TestCase(
"txt2img-sd-v2-1-768-muffin",
"txt2img?prompt=a+giant+muffin&seed=0&scheduler=ddim&model=stable-diffusion-onnx-v2-1&width=768&height=768",
max_attempts=SLOW_TEST,
),
TestCase(
"txt2img-openjourney-512-muffin",
Expand Down Expand Up @@ -312,9 +313,9 @@ def run_test(
mse = find_mse(result, ref)

if mse < test.mse_threshold:
logger.info("MSE within threshold: %.4f < %.4f", mse, test.mse_threshold)
logger.info("MSE within threshold: %.5f < %.5f", mse, test.mse_threshold)
else:
logger.warning("MSE above threshold: %.4f > %.4f", mse, test.mse_threshold)
logger.warning("MSE above threshold: %.5f > %.5f", mse, test.mse_threshold)
passed = False

return passed
Expand Down

0 comments on commit 3d0f243

Please sign in to comment.