22// Licensed under the MIT License.
33
44#include < string_view>
5+ #include < iostream>
56
67#include " nlohmann/json.hpp"
78#include " file_sys.h"
@@ -154,21 +155,26 @@ ImageProcessor::PreProcess(ort_extensions::span<ImageRawData> image_data,
154155OrtxStatus ImageProcessor::PreProcess (ort_extensions::span<ImageRawData> image_data, TensorResult& r) const {
155156 std::vector<TensorArgs> inputs (image_data.size ());
156157 std::vector<TensorPtr> input_tensor_objects (image_data.size ());
158+ std::cout << " ImageProcessor::PreProcess image_data size=" << image_data.size () << std::endl;
157159 for (size_t i = 0 ; i < image_data.size (); ++i) {
158160 auto & ts_input = inputs[i];
159161 ImageRawData& image = image_data[i];
160162 std::vector<int64_t > shape = {static_cast <int64_t >(image.size ())};
163+ for (int n : shape) {
164+ std::cout << n << " ," ;
165+ }
166+ std::cout << std::endl;
161167 input_tensor_objects[i] = std::make_unique<ortc::Tensor<uint8_t >>(shape, image.data ());
162168 ts_input.push_back (input_tensor_objects[i].get ());
163169 }
164-
170+ std::cout << " ImageProcessor::PreProcess Finish loop " << std::endl;
165171 std::vector<TensorArgs> outputs;
166172 OrtxRunner runner (op_plan_);
167173 auto status = runner.Run (inputs, outputs);
168174 if (!status.IsOk ()) {
169175 return status;
170176 }
171-
177+ std::cout << " ImageProcessor::PreProcess Finish Push " << std::endl;
172178 // clear the input tensors
173179 input_tensor_objects.clear ();
174180
@@ -182,6 +188,7 @@ OrtxStatus ImageProcessor::PreProcess(ort_extensions::span<ImageRawData> image_d
182188 if (status.IsOk ()) {
183189 r.SetTensors (std::move (img_result));
184190 }
191+ std::cout << " ImageProcessor::PreProcess Finish" << std::endl;
185192
186193 return status;
187194}
0 commit comments