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>
diff --git a/examples/graph_inception_v3.cpp b/examples/graph_inception_v3.cpp
index f2423eb..338c227 100644
--- a/examples/graph_inception_v3.cpp
+++ b/examples/graph_inception_v3.cpp
@@ -49,8 +49,8 @@
std::string image; /* Image data */
std::string label; /* Label data */
- constexpr float mean = 0.f; /* Mean value to subtract from the channels */
- constexpr float std = 255.f; /* Standard deviation value to divide from the channels */
+ // Create a preprocessor object
+ std::unique_ptr<IPreprocessor> preprocessor = arm_compute::support::cpp14::make_unique<TFPreproccessor>();
// 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;
@@ -92,9 +92,7 @@
graph.graph_init(int_target_hint == 2);
graph << target_hint << Tensor(TensorInfo(TensorShape(299U, 299U, 3U, 1U), 1, DataType::F32),
- get_input_accessor(image,
- mean, mean, mean,
- std, std, std, false /* Do not convert to BGR */))
+ get_input_accessor(image, std::move(preprocessor), false))
<< ConvolutionLayer(3U, 3U, 32U,
get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_1a_3x3_weights.npy"),