Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
wrappers
openvino
rs-vino
object-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 "
base-detection.h
"
7
8
9
namespace
openvino_helpers
10
{
11
/*
12
Detects object bounding boxes in an image.
13
14
Can take any object detection model with a single input layer (type="Input") and
15
a single output layer ("DetectionOutput").
16
*/
17
struct
object_detection
:
public
base_detection
18
{
19
public
:
20
struct
Result
21
{
22
int
label
;
23
float
confidence
;
24
cv::Rect
location
;
25
};
26
27
private
:
28
// User arguments via the ctor
29
double
_detection_threshold
;
30
31
// Intermediates and helpers
32
std::string
_input_layer_name
;
33
size_t
_input_width
;
// dimensions in the model
34
size_t
_input_height
;
35
std::string
_im_info_name
;
// optional
36
size_t
_im_info_size
;
37
std::string
_output_layer_name
;
38
size_t
_max_results
;
39
int
_n_enqued_frames
;
40
float
_width
;
// of the queued image
41
float
_height
;
42
43
public
:
44
object_detection
(
const
std::string
&
pathToModel
,
45
double
detectionThreshold,
46
bool
isAsync
=
true
,
47
int
maxBatch
= 1,
bool
isBatchDynamic
=
false
,
48
bool
doRawOutputMessages
=
false
);
49
50
InferenceEngine::CNNNetwork
read_network
()
override
;
51
void
submit_request
()
override
;
52
53
void
enqueue
(
const
cv::Mat &frame );
54
std::vector< Result >
fetch_results
();
55
56
float
get_width
()
const
{
return
_width
; }
57
float
get_height
()
const
{
return
_height
; }
58
};
59
}
openvino_helpers::object_detection::object_detection
object_detection(const std::string &pathToModel, double detectionThreshold, bool isAsync=true, int maxBatch=1, bool isBatchDynamic=false, bool doRawOutputMessages=false)
Definition:
object-detection.cpp:18
openvino_helpers::object_detection::_im_info_size
size_t _im_info_size
Definition:
object-detection.h:36
openvino_helpers::object_detection::_input_width
size_t _input_width
Definition:
object-detection.h:33
openvino_helpers::object_detection::Result::location
cv::Rect location
Definition:
object-detection.h:24
openvino_helpers::object_detection::_output_layer_name
std::string _output_layer_name
Definition:
object-detection.h:37
openvino_helpers::base_detection::isAsync
const bool isAsync
Definition:
base-detection.h:26
string
GLsizei const GLchar *const * string
Definition:
glad/glad/glad.h:2862
openvino_helpers::base_detection::pathToModel
std::string pathToModel
Definition:
base-detection.h:23
openvino_helpers::object_detection::Result::label
int label
Definition:
object-detection.h:22
openvino_helpers::object_detection::_input_layer_name
std::string _input_layer_name
Definition:
object-detection.h:32
openvino_helpers::object_detection::_max_results
size_t _max_results
Definition:
object-detection.h:38
base-detection.h
openvino_helpers::object_detection::_width
float _width
Definition:
object-detection.h:40
openvino_helpers::object_detection::Result
Definition:
object-detection.h:20
openvino_helpers
Definition:
age-gender-detection.cpp:13
openvino_helpers::object_detection::_n_enqued_frames
int _n_enqued_frames
Definition:
object-detection.h:39
openvino_helpers::object_detection::Result::confidence
float confidence
Definition:
object-detection.h:23
openvino_helpers::object_detection::_detection_threshold
double _detection_threshold
Definition:
object-detection.h:29
openvino_helpers::base_detection::doRawOutputMessages
const bool doRawOutputMessages
Definition:
base-detection.h:29
openvino_helpers::object_detection::read_network
InferenceEngine::CNNNetwork read_network() override
Definition:
object-detection.cpp:72
openvino_helpers::object_detection
Definition:
object-detection.h:17
openvino_helpers::base_detection::isBatchDynamic
bool isBatchDynamic
Definition:
base-detection.h:25
openvino_helpers::base_detection
Definition:
base-detection.h:18
openvino_helpers::object_detection::_im_info_name
std::string _im_info_name
Definition:
object-detection.h:35
openvino_helpers::object_detection::_input_height
size_t _input_height
Definition:
object-detection.h:34
openvino_helpers::object_detection::get_height
float get_height() const
Definition:
object-detection.h:57
openvino_helpers::object_detection::enqueue
void enqueue(const cv::Mat &frame)
Definition:
object-detection.cpp:42
openvino_helpers::object_detection::_height
float _height
Definition:
object-detection.h:41
openvino_helpers::object_detection::submit_request
void submit_request() override
Definition:
object-detection.cpp:33
openvino_helpers::object_detection::get_width
float get_width() const
Definition:
object-detection.h:56
openvino_helpers::object_detection::fetch_results
std::vector< Result > fetch_results()
Definition:
object-detection.cpp:159
openvino_helpers::base_detection::maxBatch
const size_t maxBatch
Definition:
base-detection.h:24
librealsense2
Author(s): Sergey Dorodnicov
, Doron Hirshberg
, Mark Horn
, Reagan Lopez
, Itay Carpis
autogenerated on Mon May 3 2021 02:47:38