33 int x_start = center_x - width / 2;
34 int y_start = center_y - height / 2;
35 int x_end = x_start + width;
36 int y_end = y_start + height;
41 for (
int iy = y_start; iy < y_end; iy++) {
42 for (
int ix = x_start; ix < x_end; ix++, index++) {
44 out[index] = accessor.
getValue(ix, iy);
63 Ort::RunOptions run_options;
64 auto mem_info = Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU);
66 const int center_x =
static_cast<int>(centroid.
getCentroidX() + 0.5);
67 const int center_y =
static_cast<int>(centroid.
getCentroidY() + 0.5);
83 fillCutout(*image, center_x, center_y, input_shape[2], input_shape[3], input_data);
86 model.
run<float, O>(input_data, output_data);
102 switch (model_info.model->getOutputType()) {
103 case ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT:
106 case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32:
110 throw Elements::Exception() <<
"This should have not happened!" << model_info.model->getOutputType();
113 output_dict.emplace(model_info.prop_name,
std::move(result));