aboutsummaryrefslogtreecommitdiff
path: root/tests/ImageNetDatabase.cpp
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/ImageNetDatabase.cpp
parent4c7098bfeab1ffe1cdc77f6c15548d3e73274746 (diff)
downloadarmnn-c577f2c6a3b4ddb6ba87a882723c53a248afbeba.tar.gz
Release 18.08
Diffstat (limited to 'tests/ImageNetDatabase.cpp')
-rw-r--r--tests/ImageNetDatabase.cpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/tests/ImageNetDatabase.cpp b/tests/ImageNetDatabase.cpp
deleted file mode 100644
index ac4bc21ff9..0000000000
--- a/tests/ImageNetDatabase.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// Copyright © 2017 Arm Ltd. All rights reserved.
-// See LICENSE file in the project root for full license information.
-//
-#include "InferenceTestImage.hpp"
-#include "ImageNetDatabase.hpp"
-
-#include <boost/numeric/conversion/cast.hpp>
-#include <boost/log/trivial.hpp>
-#include <boost/assert.hpp>
-#include <boost/format.hpp>
-
-#include <iostream>
-#include <fcntl.h>
-#include <array>
-
-const std::vector<ImageSet> g_DefaultImageSet =
-{
- {"shark.jpg", 2}
-};
-
-ImageNetDatabase::ImageNetDatabase(const std::string& binaryFileDirectory, unsigned int width, unsigned int height,
- const std::vector<ImageSet>& imageSet)
-: m_BinaryDirectory(binaryFileDirectory)
-, m_Height(height)
-, m_Width(width)
-, m_ImageSet(imageSet.empty() ? g_DefaultImageSet : imageSet)
-{
-}
-
-std::unique_ptr<ImageNetDatabase::TTestCaseData> ImageNetDatabase::GetTestCaseData(unsigned int testCaseId)
-{
- testCaseId = testCaseId % boost::numeric_cast<unsigned int>(m_ImageSet.size());
- const ImageSet& imageSet = m_ImageSet[testCaseId];
- const std::string fullPath = m_BinaryDirectory + imageSet.first;
-
- InferenceTestImage image(fullPath.c_str());
- image.Resize(m_Width, m_Height);
-
- // The model expects image data in BGR format
- std::vector<float> inputImageData = GetImageDataInArmNnLayoutAsFloatsSubtractingMean(ImageChannelLayout::Bgr,
- image, m_MeanBgr);
-
- // list of labels: https://gist.github.com/yrevar/942d3a0ac09ec9e5eb3a
- const unsigned int label = imageSet.second;
- return std::make_unique<TTestCaseData>(label, std::move(inputImageData));
-}