Skip to content

Commit

Permalink
dev(narugo): add seq test for bikini plus score
Browse files Browse the repository at this point in the history
  • Loading branch information
narugo1992 committed Jan 26, 2024
1 parent 0db6c82 commit 91ec60f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/controllability/test_bikini_plus.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pathlib
import shutil

import numpy as np
import pytest
from hbutils.system import TemporaryDirectory
from imgutils.data import load_image
Expand Down Expand Up @@ -98,6 +99,13 @@ def test_score(self, bikini_plus_metrics, bikini_image_files):
0.8555319857366422, 0.8579074531926136, 0.8362479325036504, 0.839586421120691, 0.83640841923855,
])

def test_score_files(self, bikini_plus_metrics, bikini_image_files):
assert np.isclose(bikini_plus_metrics.score(bikini_image_files, mode='seq'), np.array([
0.8837757309353425, 0.8933908126091592, 0.9055491415894145, 0.8882521965374851, 0.8927720615148468,
0.8469945459720423, 0.8399211360890133, 0.8098674415860692, 0.8363121274014674, 0.8389884182718645,
0.8555319857366422, 0.8579074531926136, 0.8362479325036504, 0.839586421120691, 0.83640841923855,
])).all()

def test_score_dirs(self, bikini_image_dirs, bikini_plus_metrics):
assert [bikini_plus_metrics.score(img_file) for img_file in bikini_image_dirs] == pytest.approx([
0.8837757309353425, 0.8933908126091592, 0.9055491415894145, 0.8882521965374851, 0.8927720615148468,
Expand Down

0 comments on commit 91ec60f

Please sign in to comment.