diff --git a/inference-engine/samples/benchmark_app/main.cpp b/inference-engine/samples/benchmark_app/main.cpp index 4910d594998..ed2153c2bd9 100644 --- a/inference-engine/samples/benchmark_app/main.cpp +++ b/inference-engine/samples/benchmark_app/main.cpp @@ -378,18 +378,21 @@ int main(int argc, char *argv[]) { topology_name = cnnNetwork.getName(); slog::info << (FLAGS_b != 0 ? "Network batch size was changed to: " : "Network batch size: ") << batchSize << slog::endl; - // ----------------- 6. Configuring input ---------------------------------------------------------------------- + // ----------------- 6. Configuring inputs and outputs ---------------------------------------------------------------------- next_step(); - for (auto& item : inputInfo) { - if (app_inputs_info.at(item.first).isImage()) { - /** Set the precision of input data provided by the user, should be called before load of the network to the device **/ + processPrecision(cnnNetwork, FLAGS_ip, FLAGS_op, FLAGS_iop); + for (auto& item : cnnNetwork.getInputsInfo()) { + // if precision for input set by user, then set it to app_inputs + // if it an image, set U8 + if (!FLAGS_ip.empty() || FLAGS_iop.find(item.first) != std::string::npos) { + app_inputs_info.at(item.first).precision = item.second->getPrecision(); + } else if (app_inputs_info.at(item.first).isImage()) { app_inputs_info.at(item.first).precision = Precision::U8; item.second->setPrecision(app_inputs_info.at(item.first).precision); } } - processPrecision(cnnNetwork, FLAGS_ip, FLAGS_op, FLAGS_iop); printInputAndOutputsInfo(cnnNetwork); // ----------------- 7. Loading the model to the device -------------------------------------------------------- diff --git a/tools/benchmark/utils/utils.py b/tools/benchmark/utils/utils.py index 7fea6b1a46e..9e1dc9ad36c 100644 --- a/tools/benchmark/utils/utils.py +++ b/tools/benchmark/utils/utils.py @@ -57,9 +57,8 @@ def _configure_network_inputs(ie_network: IENetwork, app_inputs_info, input_prec input_info = ie_network.input_info for key in input_info.keys(): - if app_inputs_info[key].is_image: - app_inputs_info[key].precision = input_precision - input_info[key].precision = input_precision + app_inputs_info[key].precision = input_precision + input_info[key].precision = input_precision def _configure_network_outputs(ie_network: IENetwork, output_precision: str): output_info = ie_network.outputs