ea01203d7ac7f94dc089d51ed4620a40df880dc6
[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 #pragma once
19 #include "cldnn.h"
20 /// @addtogroup c_api C API
21 /// @{
22 /// @addtogroup c_topology Network Topology
23 /// @{
24 /// @addtogroup c_primitives Primitives
25 /// @{
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /// @brief Select method for coding the prior-boxes in Detection Output layer ( @CLDNN_PRIMITIVE_DESC{detection_output} ).
32 typedef enum /*:int32_t*/ {
33     cldnn_code_type_corner,
34     cldnn_code_type_center_size,
35     cldnn_code_type_corner_size,
36 } cldnn_prior_box_code_type;
37
38 /// @brief Generates a list of detections based on location and confidence predictions by doing non maximum suppression.
39 /// @details Each row is a 7 dimension vector, which stores: [image_id, label, confidence, xmin, ymin, xmax, ymax].
40 /// If number of detections per image is lower than keep_top_k, will write dummy results at the end with image_id=-1.
41 CLDNN_BEGIN_PRIMITIVE_DESC(detection_output)
42 /// @brief Number of classes to be predicted.
43 uint32_t num_classes;
44 /// @brief Number of total bounding boxes to be kept per image after NMS step.
45 uint32_t keep_top_k;
46 /// @brief If not 0, bounding box are shared among different classes.
47 uint32_t share_location;
48 /// @brief Background label id (-1 if there is no background class).
49 int background_label_id;
50 /// @brief Threshold for NMS step.
51 float nms_threshold;
52 /// @brief Maximum number of results to be kept in NMS.
53 int top_k;
54 /// @brief Used for adaptive NMS.
55 float eta;
56 /// @brief Type of coding method for bounding box. See #cldnn_prior_box_code_type.
57 int32_t code_type;
58 /// @brief If not 0, variance is encoded in target; otherwise we need to adjust the predicted offset accordingly.
59 uint32_t variance_encoded_in_target;
60 /// @brief Only keep detections with confidences larger than this threshold.
61 float confidence_threshold;
62 /// @brief Number of elements in a single prior description (4 if priors calculated using PriorBox layer, 5 - if Proposal)
63 int32_t prior_info_size;
64 /// @brief Offset of the box coordinates w.r.t. the beginning of a prior info record
65 int32_t prior_coordinates_offset;
66 /// @brief If true, priors are normalized to [0; 1] range.
67 uint32_t prior_is_normalized;
68 /// @brief Width of input image.
69 int32_t input_width;
70 /// @brief Height of input image.
71 int32_t input_height;
72 /// @brief Decrease label id to skip background label equal to 0. Can't be used simultaneously with background_label_id.
73 int32_t decrease_label_id;
74 /// @brief Clip decoded boxes right after decoding
75 int32_t clip_before_nms;
76 /// @brief Clip decoded boxes after nms step
77 int32_t clip_after_nms;
78 CLDNN_END_PRIMITIVE_DESC(detection_output)
79
80 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(detection_output);
81
82 #ifdef __cplusplus
83 }
84 #endif
85
86 /// @}
87 /// @}
88 /// @}
89