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;
24  const size_t maxBatch;
26  const bool isAsync;
27  mutable bool enablingChecked;
28  mutable bool _enabled;
29  const bool doRawOutputMessages;
30 
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 }
openvino_helpers::base_detection::read_network
virtual InferenceEngine::CNNNetwork read_network()=0
openvino_helpers::base_detection::isAsync
const bool isAsync
Definition: base-detection.h:26
openvino_helpers::base_detection::_request
InferenceEngine::InferRequest::Ptr _request
Definition: base-detection.h:21
openvino_helpers::base_detection::load_into
void load_into(InferenceEngine::Core &ie, const std::string &deviceName)
Definition: base-detection.cpp:58
openvino_helpers::base_detection::maxBatch
const size_t maxBatch
Definition: base-detection.h:24
openvino_helpers::base_detection::pathToModel
std::string pathToModel
Definition: base-detection.h:23
string
GLsizei const GLchar *const * string
Definition: glad/glad/glad.h:2861
openvino_helpers::base_detection::isBatchDynamic
bool isBatchDynamic
Definition: base-detection.h:25
openvino_helpers::base_detection::doRawOutputMessages
const bool doRawOutputMessages
Definition: base-detection.h:29
openvino_helpers::base_detection::~base_detection
virtual ~base_detection()=default
openvino_helpers::base_detection::base_detection
base_detection(std::string topoName, const std::string &pathToModel, int maxBatch, bool isBatchDynamic, bool isAsync, bool doRawOutputMessages)
Definition: base-detection.cpp:13
openvino_helpers::base_detection::_enabled
bool _enabled
Definition: base-detection.h:28
openvino-helpers.h
rs.hpp
openvino_helpers::base_detection::wait
virtual void wait()
Definition: base-detection.cpp:37
openvino_helpers::base_detection::net
InferenceEngine::ExecutableNetwork net
Definition: base-detection.h:20
openvino_helpers::base_detection::enablingChecked
bool enablingChecked
Definition: base-detection.h:27
openvino_helpers
Definition: age-gender-detection.cpp:12
openvino_helpers::base_detection::enabled
bool enabled() const
Definition: base-detection.cpp:45
openvino_helpers::base_detection::operator->
InferenceEngine::ExecutableNetwork * operator->()
Definition: base-detection.h:42
openvino_helpers::base_detection
Definition: base-detection.h:18
openvino_helpers::base_detection::topoName
std::string topoName
Definition: base-detection.h:22
openvino_helpers::base_detection::submit_request
virtual void submit_request()
Definition: base-detection.cpp:26


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Fri Aug 2 2024 08:30:01