base-detection.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2019 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 
6 #include <librealsense2/rs.hpp>
7 #include <rs-vino/openvino-helpers.h> // include all the InferenceEngine headers
8 #include <string>
9 
10 
11 namespace openvino_helpers
12 {
13  /*
14  Base class for any type of OpenVINO detection implementation, e.g. object_detection, age_gender_detection, etc.
15 
16  Encapsulates an ExecutableNetwork via operator->().
17  */
19  {
20  InferenceEngine::ExecutableNetwork net;
21  InferenceEngine::InferRequest::Ptr _request;
22  std::string topoName;
23  std::string pathToModel;
24  const size_t maxBatch;
26  const bool isAsync;
27  mutable bool enablingChecked;
28  mutable bool _enabled;
29  const bool doRawOutputMessages;
30 
31  base_detection( std::string topoName,
32  const std::string &pathToModel,
33  int maxBatch, bool isBatchDynamic, bool isAsync,
34  bool doRawOutputMessages );
35 
36  virtual ~base_detection() = default;
37 
38  // Loads the network into the Inference Engine device
39  void load_into( InferenceEngine::Core & ie, const std::string & deviceName );
40 
41  // Encapsulate the contained ExecutableNetwork
42  InferenceEngine::ExecutableNetwork* operator->() { return &net; }
43 
44  // Each detector will implement its own reading of the network
45  virtual InferenceEngine::CNNNetwork read_network() = 0;
46 
47  virtual void submit_request();
48  virtual void wait();
49 
50  bool enabled() const;
51  };
52 }
InferenceEngine::InferRequest::Ptr _request
base_detection(std::string topoName, const std::string &pathToModel, int maxBatch, bool isBatchDynamic, bool isAsync, bool doRawOutputMessages)
InferenceEngine::ExecutableNetwork net
void load_into(InferenceEngine::Core &ie, const std::string &deviceName)
virtual ~base_detection()=default
virtual InferenceEngine::CNNNetwork read_network()=0
InferenceEngine::ExecutableNetwork * operator->()


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Thu Dec 22 2022 03:41:42