Skip to content

Commit 2af4d58

Browse files
committed
Update test_accuracy load_image for anomaly too
1 parent 8674640 commit 2af4d58

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/cpp/test_accuracy.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ TEST_P(ModelParameterizedTest, AccuracyTest) {
134134

135135
for (auto& test_data : data.test_data) {
136136
std::string image_path = DATA_DIR + '/' + test_data.image;
137-
cv::Mat image = cv::imread(image_path);
137+
auto image = load_image(image_path, use_tiling, data.input_res);
138138
auto result = model.infer(image);
139139

140140
EXPECT_EQ(std::string{result}, test_data.reference[0]);
@@ -182,7 +182,7 @@ TEST_P(ModelParameterizedTest, SerializedAccuracyTest) {
182182
auto model = Classification::load(model_path);
183183
for (auto& test_data : data.test_data) {
184184
std::string image_path = DATA_DIR + '/' + test_data.image;
185-
cv::Mat image = cv::imread(image_path);
185+
auto image = load_image(image_path, use_tiling, data.input_res);
186186
auto result = model.infer(image);
187187

188188
EXPECT_EQ(std::string{result}, test_data.reference[0]);
@@ -255,7 +255,7 @@ TEST_P(ModelParameterizedTest, AccuracyTestBatch) {
255255

256256
for (auto& test_data : data.test_data) {
257257
std::string image_path = DATA_DIR + '/' + test_data.image;
258-
cv::Mat image = cv::imread(image_path);
258+
auto image = load_image(image_path, use_tiling, data.input_res);
259259
auto result = model.inferBatch({image});
260260

261261
ASSERT_EQ(result.size(), 1);

0 commit comments

Comments
 (0)