Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / api / C / detection_output.h
1 /*
2 // Copyright (c) 2016 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16
17 ///////////////////////////////////////////////////////////////////////////////////////////////////
18 #ifndef DETECTION_OUTPUT_H
19 #define DETECTION_OUTPUT_H
20
21 #include "cldnn.h"
22 /// @addtogroup c_api C API
23 /// @{
24 /// @addtogroup c_topology Network Topology
25 /// @{
26 /// @addtogroup c_primitives Primitives
27 /// @{
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /// @brief Select method for coding the prior-boxes in Detection Output layer ( @CLDNN_PRIMITIVE_DESC{detection_output} ).
34 typedef enum /*:int32_t*/
35 {
36     cldnn_code_type_corner,
37     cldnn_code_type_center_size,
38     cldnn_code_type_corner_size,
39 } cldnn_prior_box_code_type;
40
41 /// @brief Generates a list of detections based on location and confidence predictions by doing non maximum suppression.
42 /// @details Each row is a 7 dimension vector, which stores: [image_id, label, confidence, xmin, ymin, xmax, ymax].
43 /// If number of detections per image is lower than keep_top_k, will write dummy results at the end with image_id=-1.
44 CLDNN_BEGIN_PRIMITIVE_DESC(detection_output)
45 /// @brief Number of classes to be predicted.
46 uint32_t num_classes;
47 /// @brief Number of total bounding boxes to be kept per image after NMS step.
48 uint32_t keep_top_k;
49 /// @brief If not 0, bounding box are shared among different classes.
50 uint32_t share_location;
51 /// @brief Background label id (-1 if there is no background class).
52 int background_label_id;
53 /// @brief Threshold for NMS step.
54 float nms_threshold;
55 /// @brief Maximum number of results to be kept in NMS.
56 int top_k;
57 /// @brief Used for adaptive NMS.
58 float eta;
59 /// @brief Type of coding method for bounding box. See #cldnn_prior_box_code_type.
60 int32_t code_type;
61 /// @brief If not 0, variance is encoded in target; otherwise we need to adjust the predicted offset accordingly.
62 uint32_t variance_encoded_in_target;
63 /// @brief Only keep detections with confidences larger than this threshold.
64 float confidence_threshold;
65 /// @brief Number of elements in a single prior description (4 if priors calculated using PriorBox layer, 5 - if Proposal)
66 int32_t prior_info_size;
67 /// @brief Offset of the box coordinates w.r.t. the beginning of a prior info record
68 int32_t prior_coordinates_offset;
69 /// @brief If true, priors are normalized to [0; 1] range.
70 uint32_t prior_is_normalized;
71 /// @brief Width of input image.
72 int32_t input_width;
73 /// @brief Height of input image.
74 int32_t input_height;
75 /// @brief Decrease label id to skip background label equal to 0. Can't be used simultaneously with background_label_id.
76 int32_t decrease_label_id;
77 /// @brief Clip decoded boxes right after decoding
78 int32_t clip_before_nms;
79 /// @brief Clip decoded boxes after nms step
80 int32_t clip_after_nms;
81 CLDNN_END_PRIMITIVE_DESC(detection_output)
82
83 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(detection_output);
84
85 #ifdef __cplusplus
86 }
87 #endif
88
89 /// @}
90 /// @}
91 /// @}
92 #endif /* DETECTION_OUTPUT_H */