blob: 20ff2be0bc0516bbe2123dfe204945b3bce3be05 [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa014fcda012018-03-09 14:13:49 +00004//
5#include "../InferenceTest.hpp"
telsoa01c577f2c2018-08-31 09:22:23 +01006#include "../CaffePreprocessor.hpp"
telsoa014fcda012018-03-09 14:13:49 +00007#include "armnnCaffeParser/ICaffeParser.hpp"
8
9int main(int argc, char* argv[])
10{
11 armnn::TensorShape inputTensorShape({ 1, 3, 224, 224 });
surmeh013537c2c2018-05-18 16:31:43 +010012 int retVal = EXIT_FAILURE;
13 try
14 {
telsoa01c577f2c2018-08-31 09:22:23 +010015 using DataType = float;
16 using DatabaseType = CaffePreprocessor;
17 using ParserType = armnnCaffeParser::ICaffeParser;
18 using ModelType = InferenceModel<ParserType, DataType>;
19
surmeh013537c2c2018-05-18 16:31:43 +010020 // Coverity fix: ClassifierInferenceTestMain() may throw uncaught exceptions.
telsoa01c577f2c2018-08-31 09:22:23 +010021 retVal = armnn::test::ClassifierInferenceTestMain<DatabaseType, ParserType>(
surmeh013537c2c2018-05-18 16:31:43 +010022 argc, argv, "VGG_CNN_S.caffemodel", true,
23 "input", "prob", { 0 },
telsoa01c577f2c2018-08-31 09:22:23 +010024 [](const char* dataDir, const ModelType&) {
25 return DatabaseType(dataDir, 224, 224);
26 }, &inputTensorShape);
surmeh013537c2c2018-05-18 16:31:43 +010027 }
28 catch (const std::exception& e)
29 {
30 // Coverity fix: BOOST_LOG_TRIVIAL (typically used to report errors) may throw an
31 // exception of type std::length_error.
32 // Using stderr instead in this context as there is no point in nesting try-catch blocks here.
33 std::cerr << "WARNING: CaffeVGG-Armnn: An error has occurred when running "
34 "the classifier inference tests: " << e.what() << std::endl;
35 }
36 return retVal;
telsoa014fcda012018-03-09 14:13:49 +000037}