Skip to content

Commit f630b06

Browse files
committed
Debug
1 parent 52e1ef5 commit f630b06

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

shared/api/c_api_processor.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "ortx_processor.h"
55
#include "image_processor.h"
6+
#include <iostream>
67

78
#include "c_api_utils.hpp"
89

@@ -89,8 +90,10 @@ extError_t ORTX_API_CALL OrtxImagePreProcess(OrtxProcessor* processor, OrtxRawIm
8990
}
9091

9192
auto result_ptr = std::make_unique<TensorResult>();
93+
std::cout << "OrtxImagePreProcess: num_images=" << images_ptr->num_images << std::endl;
9294
status =
9395
processor_ptr->PreProcess(ort_extensions::span(images_ptr->images.get(), images_ptr->num_images), *result_ptr);
96+
std::cout << "OrtxImagePreProcess: Finish PreProcess" << std::endl;
9497
if (status.IsOk()) {
9598
*result = static_cast<OrtxTensorResult*>(result_ptr.release());
9699
} else {

shared/api/image_processor.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
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,6 +155,7 @@ ImageProcessor::PreProcess(ort_extensions::span<ImageRawData> image_data,
154155
OrtxStatus 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];
@@ -168,7 +170,7 @@ OrtxStatus ImageProcessor::PreProcess(ort_extensions::span<ImageRawData> image_d
168170
if (!status.IsOk()) {
169171
return status;
170172
}
171-
173+
std::cout << "ImageProcessor::PreProcess Finish Push" << std::endl;
172174
// clear the input tensors
173175
input_tensor_objects.clear();
174176

@@ -182,6 +184,7 @@ OrtxStatus ImageProcessor::PreProcess(ort_extensions::span<ImageRawData> image_d
182184
if (status.IsOk()) {
183185
r.SetTensors(std::move(img_result));
184186
}
187+
std::cout << "ImageProcessor::PreProcess Finish" << std::endl;
185188

186189
return status;
187190
}

0 commit comments

Comments
 (0)