summaryrefslogtreecommitdiff
path: root/python/openvino/runtime/dla_benchmark/inputs_filling.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'python/openvino/runtime/dla_benchmark/inputs_filling.hpp')
-rw-r--r--python/openvino/runtime/dla_benchmark/inputs_filling.hpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/python/openvino/runtime/dla_benchmark/inputs_filling.hpp b/python/openvino/runtime/dla_benchmark/inputs_filling.hpp
new file mode 100644
index 0000000..e392bd7
--- /dev/null
+++ b/python/openvino/runtime/dla_benchmark/inputs_filling.hpp
@@ -0,0 +1,45 @@
+// Copyright (C) 2018-2023 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+// Description: This file defines methods to fill input data into tensors
+
+#pragma once
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include <openvino/openvino.hpp>
+#include "infer_request_wrap.hpp"
+
+/**
+ * @brief Main function used by DLA benchmark, creates input tensors based off of input files and precision
+ *
+ * Only creates static tensors (no dims of -1). Calls all other functions in this file.
+ *
+ * @param input_files vector of input file paths
+ * @param batch_size batch size of input
+ * @param inputs_info map of input name to InputInfo struct which contains useful input information
+ * such as precision, tensor layout
+ * @param requests_num number of infer requests
+ * @param bgr boolean indicating if channels are reversed, corresponds to user bgr flag
+ * @param is_binary_data boolean indicating if the image data should be binary, corresponding to user binary flag
+ * @param verbose Verbosity boolean. If true, additional logs are printed
+ * @return A map of input name with tensor vectors. TensorVector being an alias of ov::Tensors where
+ * each index corresponds to the batch
+*/
+std::map<std::string, ov::TensorVector> GetStaticTensors(const std::vector<std::string>& input_files,
+ const size_t& batch_size,
+ dla_benchmark::InputsInfo& app_inputs_info,
+ size_t requests_num,
+ std::string resize_type,
+ bool bgr,
+ bool is_binary_data,
+ bool verbose);
+/**
+ * @brief Copies data from a source OpenVINO Tensor to a destination Tensor.
+ *
+ * @param dst The destination Tensor where data will be copied.
+ * @param src The source Tensor from which data will be copied.
+ */
+void CopyTensorData(ov::Tensor& dst, const ov::Tensor& src);