forked from google-ai-edge/mediapipe
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add inference calculator GetContract tests To run tests: bazelisk test --test_output=all //mediapipe/calculators/ovms:openvinomodelserversessioncalculator_test bazelisk test --test_output=all //mediapipe/calculators/ovms:openvinoinferencecalculator_test * Update OVMS in WORKSPACE * Exclude sporadic from CI This test hase failure rate ~40% locally
- Loading branch information
Showing
14 changed files
with
718 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#pragma once | ||
//***************************************************************************** | ||
// Copyright 2023 Intel Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
//***************************************************************************** | ||
#include <memory> | ||
#include <unordered_map> | ||
|
||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" | ||
#include "mediapipe/framework/calculator_framework.h" | ||
#include "mediapipe/framework/port/canonical_errors.h" | ||
#pragma GCC diagnostic pop | ||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wall" | ||
#include "tensorflow/lite/interpreter.h" | ||
#pragma GCC diagnostic pop | ||
class InferenceAdapter; | ||
namespace mediapipe { | ||
class OpenVINOInferenceCalculator : public CalculatorBase { | ||
std::shared_ptr<::InferenceAdapter> session{nullptr}; | ||
std::unordered_map<std::string, std::string> outputNameToTag; | ||
std::vector<std::string> input_order_list; | ||
std::vector<std::string> output_order_list; | ||
std::unique_ptr<tflite::Interpreter> interpreter_ = absl::make_unique<tflite::Interpreter>(); | ||
bool initialized = false; | ||
public: | ||
static absl::Status GetContract(CalculatorContract* cc); | ||
absl::Status Close(CalculatorContext* cc) override final; | ||
absl::Status Open(CalculatorContext* cc) override final; | ||
absl::Status Process(CalculatorContext* cc) override final; | ||
}; | ||
} // namespace mediapipe |
Oops, something went wrong.