Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
atobiszei committed Oct 30, 2024
1 parent d619bb7 commit c194f2e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions model_api/cpp/adapters/src/openvino_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,17 @@ void OpenVINOInferenceAdapter::loadModel(const std::shared_ptr<const ov::Model>&
}

void OpenVINOInferenceAdapter::infer(const InferenceInput&, InferenceOutput&) {
throw std::runtime_error("Not implemented");
auto request = asyncQueue->operator[](asyncQueue->get_idle_request_id());
for (const auto& [name, tensor] : input) {
request.set_tensor(item.first, item.second);
}
for (const auto& [name, tensor] : output) {
request.set_tensor(name, tensor);
}
request.infer();
for (const auto& name : outputNames) {
output[name] = request.get_tensor(item);
}
}

InferenceOutput OpenVINOInferenceAdapter::infer(const InferenceInput& input) {
Expand Down Expand Up @@ -100,7 +110,7 @@ ov::PartialShape OpenVINOInferenceAdapter::getInputShape(const std::string& inpu
return compiledModel.input(inputName).get_partial_shape();
}
ov::PartialShape OpenVINOInferenceAdapter::getOutputShape(const std::string& outputName) const {
return compiledModel.output(outputName).get_shape();
return compiledModel.output(outputName).get_partial_shape();
}

void OpenVINOInferenceAdapter::initInputsOutputs() {
Expand Down

0 comments on commit c194f2e

Please sign in to comment.