2
2
// Licensed under the MIT License.
3
3
4
4
#include < string_view>
5
+ #include < iostream>
5
6
6
7
#include " nlohmann/json.hpp"
7
8
#include " file_sys.h"
@@ -154,21 +155,26 @@ ImageProcessor::PreProcess(ort_extensions::span<ImageRawData> image_data,
154
155
OrtxStatus ImageProcessor::PreProcess (ort_extensions::span<ImageRawData> image_data, TensorResult& r) const {
155
156
std::vector<TensorArgs> inputs (image_data.size ());
156
157
std::vector<TensorPtr> input_tensor_objects (image_data.size ());
158
+ std::cout << " ImageProcessor::PreProcess image_data size=" << image_data.size () << std::endl;
157
159
for (size_t i = 0 ; i < image_data.size (); ++i) {
158
160
auto & ts_input = inputs[i];
159
161
ImageRawData& image = image_data[i];
160
162
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;
161
167
input_tensor_objects[i] = std::make_unique<ortc::Tensor<uint8_t >>(shape, image.data ());
162
168
ts_input.push_back (input_tensor_objects[i].get ());
163
169
}
164
-
170
+ std::cout << " ImageProcessor::PreProcess Finish loop " << std::endl;
165
171
std::vector<TensorArgs> outputs;
166
172
OrtxRunner runner (op_plan_);
167
173
auto status = runner.Run (inputs, outputs);
168
174
if (!status.IsOk ()) {
169
175
return status;
170
176
}
171
-
177
+ std::cout << " ImageProcessor::PreProcess Finish Push " << std::endl;
172
178
// clear the input tensors
173
179
input_tensor_objects.clear ();
174
180
@@ -182,6 +188,7 @@ OrtxStatus ImageProcessor::PreProcess(ort_extensions::span<ImageRawData> image_d
182
188
if (status.IsOk ()) {
183
189
r.SetTensors (std::move (img_result));
184
190
}
191
+ std::cout << " ImageProcessor::PreProcess Finish" << std::endl;
185
192
186
193
return status;
187
194
}
0 commit comments