aboutsummaryrefslogtreecommitdiff
path: root/examples/graph_vgg16.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-02-16 11:42:38 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:47:18 +0000
commit140fdc76e99c92b2f71865b679de0659a70b713f (patch)
treea8218bfd303772ed68f6c4d57e17d5ddd7b61ce0 /examples/graph_vgg16.cpp
parent72f39be2f372b9a810cb27320dba5d0722407549 (diff)
downloadComputeLibrary-140fdc76e99c92b2f71865b679de0659a70b713f.tar.gz
COMPMID-913: Fix preprocessing step for TF models.
Change-Id: If0fbb6bbe5384038124d3dc189274b8266f796ca Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/120771 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Reviewed-by: Pablo Tello <pablo.tello@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'examples/graph_vgg16.cpp')
-rw-r--r--examples/graph_vgg16.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/graph_vgg16.cpp b/examples/graph_vgg16.cpp
index ccb9dbb19d..eb8bd42e1a 100644
--- a/examples/graph_vgg16.cpp
+++ b/examples/graph_vgg16.cpp
@@ -61,9 +61,9 @@ public:
std::string image; /* Image data */
std::string label; /* Label data */
- constexpr float mean_r = 123.68f; /* Mean value to subtract from red channel */
- constexpr float mean_g = 116.779f; /* Mean value to subtract from green channel */
- constexpr float mean_b = 103.939f; /* Mean value to subtract from blue channel */
+ // Create a preprocessor object
+ const std::array<float, 3> mean_rgb{ { 123.68f, 116.779f, 103.939f } };
+ std::unique_ptr<IPreprocessor> preprocessor = arm_compute::support::cpp14::make_unique<CaffePreproccessor>(mean_rgb);
// Set target. 0 (NEON), 1 (OpenCL), 2 (OpenCL with Tuner). By default it is NEON
const int int_target_hint = argc > 1 ? std::strtol(argv[1], nullptr, 10) : 0;
@@ -111,7 +111,7 @@ public:
graph << target_hint
<< convolution_hint
<< Tensor(TensorInfo(TensorShape(224U, 224U, 3U, 1U), 1, DataType::F32),
- get_input_accessor(image, mean_r, mean_g, mean_b))
+ get_input_accessor(image, std::move(preprocessor)))
// Layer 1
<< ConvolutionLayer(
3U, 3U, 64U,