Skip to content

Commit c194f2e

Browse files
committed
Fixes
1 parent d619bb7 commit c194f2e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

model_api/cpp/adapters/src/openvino_adapter.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,17 @@ void OpenVINOInferenceAdapter::loadModel(const std::shared_ptr<const ov::Model>&
5050
}
5151

5252
void OpenVINOInferenceAdapter::infer(const InferenceInput&, InferenceOutput&) {
53-
throw std::runtime_error("Not implemented");
53+
auto request = asyncQueue->operator[](asyncQueue->get_idle_request_id());
54+
for (const auto& [name, tensor] : input) {
55+
request.set_tensor(item.first, item.second);
56+
}
57+
for (const auto& [name, tensor] : output) {
58+
request.set_tensor(name, tensor);
59+
}
60+
request.infer();
61+
for (const auto& name : outputNames) {
62+
output[name] = request.get_tensor(item);
63+
}
5464
}
5565

5666
InferenceOutput OpenVINOInferenceAdapter::infer(const InferenceInput& input) {
@@ -100,7 +110,7 @@ ov::PartialShape OpenVINOInferenceAdapter::getInputShape(const std::string& inpu
100110
return compiledModel.input(inputName).get_partial_shape();
101111
}
102112
ov::PartialShape OpenVINOInferenceAdapter::getOutputShape(const std::string& outputName) const {
103-
return compiledModel.output(outputName).get_shape();
113+
return compiledModel.output(outputName).get_partial_shape();
104114
}
105115

106116
void OpenVINOInferenceAdapter::initInputsOutputs() {

0 commit comments

Comments
 (0)