29 #include "utils/Utils.h"
36 class GraphSRCNN955Example :
public Example
39 GraphSRCNN955Example()
41 common_opts(cmd_parser),
42 model_input_width(nullptr),
43 model_input_height(nullptr),
51 model_input_width->
set_help(
"Input image width.");
52 model_input_height->
set_help(
"Input image height.");
54 GraphSRCNN955Example(
const GraphSRCNN955Example &) =
delete;
55 GraphSRCNN955Example &operator=(
const GraphSRCNN955Example &) =
delete;
56 ~GraphSRCNN955Example()
override =
default;
57 bool do_setup(
int argc,
char **argv)
override
60 cmd_parser.parse(argc, argv);
61 cmd_parser.validate();
67 if (common_params.help)
69 cmd_parser.print_help(argv[0]);
74 const unsigned int image_width = model_input_width->value();
75 const unsigned int image_height = model_input_height->
value();
78 std::cout << common_params << std::endl;
79 std::cout <<
"Image width: " << image_width << std::endl;
80 std::cout <<
"Image height: " << image_height << std::endl;
83 const std::string data_path = common_params.data_path;
84 const std::string model_path =
"/cnn_data/srcnn955_model/";
87 std::unique_ptr<IPreprocessor> preprocessor = std::make_unique<TFPreproccessor>();
90 const TensorShape tensor_shape =
92 common_params.data_layout);
99 graph << common_params.target << common_params.fast_math_hint
105 <<
ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
110 <<
ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
115 <<
ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
117 <<
OutputLayer(std::make_unique<DummyAccessor>(0));
122 config.
use_tuner = common_params.enable_tuner;
125 config.
mlgo_file = common_params.mlgo_file;
129 graph.finalize(common_params.target, config);
134 void do_run()
override
161 int main(
int argc,
char **argv)
163 return arm_compute::utils::run_example<GraphSRCNN955Example>(argc, argv);