2 // Copyright (c) 2016 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 ///////////////////////////////////////////////////////////////////////////////////////////////////
20 /// @addtogroup c_api C API
22 /// @addtogroup c_topology Network Topology
24 /// @addtogroup c_primitives Primitives
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;
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.
44 /// @brief Number of total bounding boxes to be kept per image after NMS step.
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.
52 /// @brief Maximum number of results to be kept in NMS.
54 /// @brief Used for adaptive NMS.
56 /// @brief Type of coding method for bounding box. See #cldnn_prior_box_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.
70 /// @brief Height of input image.
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)
80 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(detection_output);