Skip to content

Commit d3e47dd

Browse files
authored
Fix classification bug for ResNet18DefaultBenchmark (#54)
1 parent 57a74d2 commit d3e47dd

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

benchmarks/DeepLearning/Models/Inception-V3/InceptionBenchmark.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ cv::Mat image = imagePreprocessing();
5050
intptr_t sizesInput[4] = {1, image.rows, image.cols, 3};
5151
intptr_t sizesOutnput[2] = {1, 1001};
5252

53-
Img<float, 4> input(image, true);
53+
Img<float, 4> input(image, sizesInput, true);
5454
MemRef<float, 2> output(sizesOutnput);
5555

5656
// Define benchmark function.

benchmarks/DeepLearning/Models/MobileNet-V2/MobileNetBenchmark.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ cv::Mat image = imagePreprocessing();
5050
intptr_t sizesInput[4] = {1, image.rows, image.cols, 3};
5151
intptr_t sizesOutnput[2] = {1, 1001};
5252

53-
Img<float, 4> input(image, true);
53+
Img<float, 4> input(image, sizesInput, true);
5454
MemRef<float, 2> output(sizesOutnput);
5555

5656
// Define benchmark function.

benchmarks/DeepLearning/Models/MobileNet-V3/MobileNetBenchmark.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ cv::Mat image = imagePreprocessing();
5050
intptr_t sizesInput[4] = {1, image.rows, image.cols, 3};
5151
intptr_t sizesOutnput[2] = {1, 1001};
5252

53-
// MemRef<float, 4> input(image, sizesInput, IMAGE_MATRIX_OPERATION::NORMALIZE);
54-
Img<float, 4> input(image, true);
53+
Img<float, 4> input(image, sizesInput, true);
5554
MemRef<float, 2> output(sizesOutnput);
5655

5756
// Define benchmark function.

benchmarks/DeepLearning/Models/ResNet-18/ResNet18DefaultBenchmark.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ void _mlir_ciface_forward(MemRef<float, 2> *output, Img<float, 4> *input);
3535
}
3636

3737
const cv::Mat imagePreprocessing() {
38-
// std::cout << "preprocessing!!!" << std::endl;
3938
cv::Mat inputImage =
4039
cv::imread("../../benchmarks/DeepLearning/Models/ResNet-18/Images/"
4140
"YellowLabradorLooking_new.jpg");
@@ -50,10 +49,10 @@ const cv::Mat imagePreprocessing() {
5049

5150
cv::Mat image = imagePreprocessing();
5251

53-
intptr_t sizesInput[4] = {1, image.rows, image.cols, 3};
52+
intptr_t sizesInput[4] = {1, 3, image.rows, image.cols};
5453
intptr_t sizesOutput[2] = {1, 1000};
5554

56-
Img<float, 4> input(image, true);
55+
Img<float, 4> input(image, sizesInput, true);
5756
MemRef<float, 2> output(sizesOutput);
5857

5958
// Define benchmark function.

benchmarks/DeepLearning/Models/ResNet-V2-50/ResNetBenchmark.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ cv::Mat image = imagePreprocessing();
5050
intptr_t sizesInput[4] = {1, image.rows, image.cols, 3};
5151
intptr_t sizesOutput[2] = {1, 1001};
5252

53-
Img<float, 4> input(image, true);
53+
Img<float, 4> input(image, sizesInput, true);
5454
MemRef<float, 2> output(sizesOutput);
5555

5656
// Define benchmark function.

0 commit comments

Comments
 (0)