aboutsummaryrefslogtreecommitdiff
path: root/tests/TfMobileNet-Armnn
diff options
context:
space:
mode:
authortelsoa01 <telmo.soares@arm.com>2018-08-31 09:22:23 +0100
committertelsoa01 <telmo.soares@arm.com>2018-08-31 09:22:23 +0100
commitc577f2c6a3b4ddb6ba87a882723c53a248afbeba (patch)
treebd7d4c148df27f8be6649d313efb24f536b7cf34 /tests/TfMobileNet-Armnn
parent4c7098bfeab1ffe1cdc77f6c15548d3e73274746 (diff)
downloadarmnn-c577f2c6a3b4ddb6ba87a882723c53a248afbeba.tar.gz
Release 18.08
Diffstat (limited to 'tests/TfMobileNet-Armnn')
-rw-r--r--tests/TfMobileNet-Armnn/TfMobileNet-Armnn.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/tests/TfMobileNet-Armnn/TfMobileNet-Armnn.cpp b/tests/TfMobileNet-Armnn/TfMobileNet-Armnn.cpp
index 54759bf88a..cba70c94d3 100644
--- a/tests/TfMobileNet-Armnn/TfMobileNet-Armnn.cpp
+++ b/tests/TfMobileNet-Armnn/TfMobileNet-Armnn.cpp
@@ -3,7 +3,7 @@
// See LICENSE file in the project root for full license information.
//
#include "../InferenceTest.hpp"
-#include "../MobileNetDatabase.hpp"
+#include "../ImagePreprocessor.hpp"
#include "armnnTfParser/ITfParser.hpp"
int main(int argc, char* argv[])
@@ -15,7 +15,7 @@ int main(int argc, char* argv[])
std::vector<ImageSet> imageSet =
{
{"Dog.jpg", 209},
- // top five predictions in tensorflow:
+ // Top five predictions in tensorflow:
// -----------------------------------
// 209:Labrador retriever 0.949995
// 160:Rhodesian ridgeback 0.0270182
@@ -23,7 +23,7 @@ int main(int argc, char* argv[])
// 853:tennis ball 0.000470382
// 239:Greater Swiss Mountain dog 0.000464451
{"Cat.jpg", 283},
- // top five predictions in tensorflow:
+ // Top five predictions in tensorflow:
// -----------------------------------
// 283:tiger cat 0.579016
// 286:Egyptian cat 0.319676
@@ -31,7 +31,7 @@ int main(int argc, char* argv[])
// 288:lynx, catamount 0.011163
// 289:leopard, Panthera pardus 0.000856755
{"shark.jpg", 3},
- // top five predictions in tensorflow:
+ // Top five predictions in tensorflow:
// -----------------------------------
// 3:great white shark, white shark, ... 0.996926
// 4:tiger shark, Galeocerdo cuvieri 0.00270528
@@ -42,11 +42,21 @@ int main(int argc, char* argv[])
armnn::TensorShape inputTensorShape({ 1, 224, 224, 3 });
+ using DataType = float;
+ using DatabaseType = ImagePreprocessor<float>;
+ using ParserType = armnnTfParser::ITfParser;
+ using ModelType = InferenceModel<ParserType, DataType>;
+
// Coverity fix: ClassifierInferenceTestMain() may throw uncaught exceptions.
- retVal = armnn::test::ClassifierInferenceTestMain<MobileNetDatabase, armnnTfParser::ITfParser>(
- argc, argv, "mobilenet_v1_1.0_224_fp32.pb", true, "input", "output", { 0, 1, 2 },
- [&imageSet](const char* dataDir) {
- return MobileNetDatabase(
+ retVal = armnn::test::ClassifierInferenceTestMain<DatabaseType, ParserType>(
+ argc, argv,
+ "mobilenet_v1_1.0_224_fp32.pb", // model name
+ true, // model is binary
+ "input", "output", // input and output tensor names
+ { 0, 1, 2 }, // test images to test with as above
+ [&imageSet](const char* dataDir, const ModelType&) {
+ // This creates a 224x224x3 NHWC float tensor to pass to Armnn
+ return DatabaseType(
dataDir,
224,
224,