File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
model_api/cpp/adapters/src Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,17 @@ void OpenVINOInferenceAdapter::loadModel(const std::shared_ptr<const ov::Model>&
5050}
5151
5252void 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
5666InferenceOutput 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}
102112ov::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
106116void OpenVINOInferenceAdapter::initInputsOutputs () {
You can’t perform that action at this time.
0 commit comments