plugin
0.1.0
|
#include <async_pipeline.h>
Public Member Functions | |
AsyncPipeline (std::unique_ptr< ModelBase > &&modelInstance, const ModelConfig &config, ov::Core &core) | |
void | waitForData (bool shouldKeepOrder=true) |
bool | isReadyToProcess () |
void | waitForTotalCompletion () |
virtual int64_t | submitData (const InputData &inputData, const std::shared_ptr< MetaData > &metaData) |
virtual std::unique_ptr< ResultBase > | getResult (bool shouldKeepOrder=true) |
PerformanceMetrics | getInferenceMetircs () |
PerformanceMetrics | getPreprocessMetrics () |
PerformanceMetrics | getPostprocessMetrics () |
Protected Member Functions | |
virtual InferenceResult | getInferenceResult (bool shouldKeepOrder) |
Protected Attributes | |
std::unique_ptr< RequestsPool > | requestsPool |
std::unordered_map< int64_t, InferenceResult > | completedInferenceResults |
ov::CompiledModel | compiledModel |
std::mutex | mtx |
std::condition_variable | condVar |
int64_t | inputFrameId = 0 |
int64_t | outputFrameId = 0 |
std::exception_ptr | callbackException = nullptr |
std::unique_ptr< ModelBase > | model |
PerformanceMetrics | inferenceMetrics |
PerformanceMetrics | preprocessMetrics |
PerformanceMetrics | postprocessMetrics |
This is base class for asynchronous pipeline Derived classes should add functions for data submission and output processing
AsyncPipeline::AsyncPipeline | ( | std::unique_ptr< ModelBase > && | modelInstance, |
const ModelConfig & | config, | ||
ov::Core & | core | ||
) |
Loads model and performs required initialization
modelInstance | pointer to model object. Object it points to should not be destroyed manually after passing pointer to this function. |
config | - fine tuning configuration for model |
core | - reference to ov::Core instance to use. If it is omitted, new instance of ov::Core will be created inside. |
|
protectedvirtual |
Returns processed result, if available
shouldKeepOrder | if true, function will return processed data sequentially, keeping original frames order (as they were submitted). Otherwise, function will return processed data in random order. |
|
virtual |
Gets available data from the queue
shouldKeepOrder | if true, function will treat results as ready only if next sequential result (frame) is ready (so results can be extracted in the same order as they were submitted). Otherwise, function will return if any result is ready. |
|
inline |
|
virtual |
Submits data to the model for inference
inputData | - input data to be submitted |
metaData | - shared pointer to metadata container. Might be null. This pointer will be passed through pipeline and put to the final result structure. |
void AsyncPipeline::waitForData | ( | bool | shouldKeepOrder = true | ) |
Waits until either output data becomes available or pipeline allows to submit more input data.
shouldKeepOrder | if true, function will treat results as ready only if next sequential result (frame) is ready (so results can be extracted in the same order as they were submitted). Otherwise, function will return if any result is ready. |
|
inline |
Waits for all currently submitted requests to be completed.