TensorRT 10.5.0
NvInferPluginUtils.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef NV_INFER_PLUGIN_UTILS_H
19#define NV_INFER_PLUGIN_UTILS_H
20
22
29
30namespace nvinfer1
31{
32namespace plugin
33{
34
44{
45 float *minSize;
46 float *maxSize;
47 float *aspectRatios;
48 int32_t numMinSize;
49 int32_t numMaxSize;
51 bool flip;
53 bool clip;
54 float variance[4];
55 int32_t imgH;
56 int32_t imgW;
57 float stepH;
58 float stepW;
59 float offset;
60};
61
68{
69 int32_t poolingH;
70 int32_t poolingW;
71 int32_t featureStride;
73 int32_t preNmsTop;
74 int32_t nmsMaxOut;
78 float minBoxSize;
80};
81
89{
90 float minSize;
91 float maxSize;
92 float* aspectRatios;
94 int32_t H;
95 int32_t W;
96 float variance[4];
97};
98
106enum class CodeTypeSSD : int32_t
107{
112};
113
127{
132 int32_t numClasses;
133 int32_t topK;
135 int32_t keepTopK;
139 int32_t inputOrder[3];
142 bool isBatchAgnostic{true};
143};
144
150{
151 int32_t* leaf;
152 int32_t n;
153 int32_t* parent;
154 int32_t* child;
155 int32_t* group;
156 char** name;
157 int32_t groups;
158 int32_t* groupSize;
159 int32_t* groupOffset;
160};
161
171{
172 int32_t num;
173 int32_t coords;
174 int32_t classes;
176};
177
185{
190 int32_t numClasses;
191 int32_t topK;
192 int32_t keepTopK;
199};
200
201} // namespace plugin
202} // namespace nvinfer1
203
204#endif // NV_INFER_PLUGIN_UTILS_H
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:45
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeBase.h:46
CodeTypeSSD
The type of encoding used for decoding the bounding boxes and loc_data.
Definition: NvInferPluginUtils.h:107
@ CENTER_SIZE
Use box centers and size.
@ TF_CENTER
Use box centers and size but flip x and y coordinates.
@ CORNER_SIZE
Use box centers and size.
The TensorRT API version 1 namespace.
The DetectionOutput plugin layer generates the detection output based on location and confidence pred...
Definition: NvInferPluginUtils.h:127
int32_t backgroundLabelId
Background label ID. If there is no background class, set it as -1.
Definition: NvInferPluginUtils.h:131
float confidenceThreshold
Only consider detections whose confidences are larger than a threshold.
Definition: NvInferPluginUtils.h:136
bool confSigmoid
Set to true to calculate sigmoid of confidence scores.
Definition: NvInferPluginUtils.h:140
int32_t keepTopK
Number of total bounding boxes to be kept per image after NMS step.
Definition: NvInferPluginUtils.h:135
bool shareLocation
If true, bounding box are shared among different classes.
Definition: NvInferPluginUtils.h:128
int32_t numClasses
Number of classes to be predicted.
Definition: NvInferPluginUtils.h:132
bool varianceEncodedInTarget
Definition: NvInferPluginUtils.h:129
int32_t topK
Definition: NvInferPluginUtils.h:133
bool isNormalized
Set to true if bounding box data is normalized by the network.
Definition: NvInferPluginUtils.h:141
float nmsThreshold
Threshold to be used in NMS.
Definition: NvInferPluginUtils.h:137
CodeTypeSSD codeType
Type of coding method for bbox.
Definition: NvInferPluginUtils.h:138
The Anchor Generator plugin layer generates the prior boxes of designated sizes and aspect ratios acr...
Definition: NvInferPluginUtils.h:89
int32_t W
Width of feature map to generate anchors for.
Definition: NvInferPluginUtils.h:95
float * aspectRatios
List of aspect ratios to place on each grid point.
Definition: NvInferPluginUtils.h:92
int32_t H
Height of feature map to generate anchors for.
Definition: NvInferPluginUtils.h:94
float minSize
Scale of anchors corresponding to finest resolution.
Definition: NvInferPluginUtils.h:90
int32_t numAspectRatios
Number of elements in aspectRatios.
Definition: NvInferPluginUtils.h:93
float variance[4]
Variance for adjusting the prior boxes.
Definition: NvInferPluginUtils.h:96
float maxSize
Scale of anchors corresponding to coarsest resolution.
Definition: NvInferPluginUtils.h:91
The NMSParameters are used by the BatchedNMSPlugin for performing the non_max_suppression operation o...
Definition: NvInferPluginUtils.h:185
int32_t topK
Number of bounding boxes to be fed into the NMS step.
Definition: NvInferPluginUtils.h:191
float iouThreshold
Definition: NvInferPluginUtils.h:195
int32_t numClasses
Number of classes in the network.
Definition: NvInferPluginUtils.h:190
int32_t backgroundLabelId
Definition: NvInferPluginUtils.h:188
int32_t keepTopK
Definition: NvInferPluginUtils.h:192
bool shareLocation
Definition: NvInferPluginUtils.h:186
float scoreThreshold
Scalar threshold for score (low scoring boxes are removed).
Definition: NvInferPluginUtils.h:194
bool isNormalized
Definition: NvInferPluginUtils.h:197
The PriorBox plugin layer generates the prior boxes of designated sizes and aspect ratios across all ...
Definition: NvInferPluginUtils.h:44
float stepH
Step in H. If 0, then (float)imgH/h will be used where h is the H dimension of the 1st input tensor.
Definition: NvInferPluginUtils.h:57
float variance[4]
Variance for adjusting the prior boxes.
Definition: NvInferPluginUtils.h:54
float * aspectRatios
Aspect ratios of the boxes. Can be nullptr.
Definition: NvInferPluginUtils.h:47
float offset
Offset to the top left corner of each cell.
Definition: NvInferPluginUtils.h:59
int32_t imgW
Image width. If 0, then the W dimension of the data tensor will be used.
Definition: NvInferPluginUtils.h:56
int32_t numMaxSize
Number of elements in maxSize. Can be 0 or same as numMinSize.
Definition: NvInferPluginUtils.h:49
bool clip
If true, will clip the prior so that it is within [0,1].
Definition: NvInferPluginUtils.h:53
int32_t numMinSize
Number of elements in minSize. Must be larger than 0.
Definition: NvInferPluginUtils.h:48
float stepW
Step in W. If 0, then (float)imgW/w will be used where w is the W dimension of the 1st input tensor.
Definition: NvInferPluginUtils.h:58
bool flip
Definition: NvInferPluginUtils.h:51
float * maxSize
Maximum box size in pixels. Can be nullptr.
Definition: NvInferPluginUtils.h:46
int32_t numAspectRatios
Number of elements in aspectRatios. Can be 0.
Definition: NvInferPluginUtils.h:50
int32_t imgH
Image height. If 0, then the H dimension of the data tensor will be used.
Definition: NvInferPluginUtils.h:55
float * minSize
Minimum box size in pixels. Can not be nullptr.
Definition: NvInferPluginUtils.h:45
RPROIParams is used to create the RPROIPlugin instance.
Definition: NvInferPluginUtils.h:68
int32_t featureStride
Definition: NvInferPluginUtils.h:71
int32_t poolingH
Height of the output in pixels after ROI pooling on feature map.
Definition: NvInferPluginUtils.h:69
int32_t preNmsTop
Number of proposals to keep before applying NMS.
Definition: NvInferPluginUtils.h:73
int32_t anchorsScaleCount
Number of anchor box scales.
Definition: NvInferPluginUtils.h:76
float spatialScale
Spatial scale between the input image and the last feature map.
Definition: NvInferPluginUtils.h:79
float iouThreshold
IoU (Intersection over Union) threshold used for the NMS step.
Definition: NvInferPluginUtils.h:77
int32_t nmsMaxOut
Number of remaining proposals after applying NMS.
Definition: NvInferPluginUtils.h:74
int32_t anchorsRatioCount
Number of anchor box ratios.
Definition: NvInferPluginUtils.h:75
int32_t poolingW
Width of the output in pixels after ROI pooling on feature map.
Definition: NvInferPluginUtils.h:70
float minBoxSize
Minimum allowed bounding box size before scaling, used for anchor box calculation.
Definition: NvInferPluginUtils.h:78
The Region plugin layer performs region proposal calculation.
Definition: NvInferPluginUtils.h:171
int32_t num
Number of predicted bounding box for each grid cell.
Definition: NvInferPluginUtils.h:172
softmaxTree * smTree
Helping structure to do softmax on confidence scores.
Definition: NvInferPluginUtils.h:175
int32_t coords
Number of coordinates for a bounding box.
Definition: NvInferPluginUtils.h:173
int32_t classes
Number of classifications to be predicted.
Definition: NvInferPluginUtils.h:174
When performing yolo9000, softmaxTree is helping to do softmax on confidence scores,...
Definition: NvInferPluginUtils.h:150
int32_t * parent
Definition: NvInferPluginUtils.h:153
int32_t * leaf
Definition: NvInferPluginUtils.h:151
int32_t * group
Definition: NvInferPluginUtils.h:155
int32_t * groupOffset
Definition: NvInferPluginUtils.h:159
int32_t n
Definition: NvInferPluginUtils.h:152
int32_t * child
Definition: NvInferPluginUtils.h:154
char ** name
Definition: NvInferPluginUtils.h:156
int32_t groups
Definition: NvInferPluginUtils.h:157
int32_t * groupSize
Definition: NvInferPluginUtils.h:158

  Copyright © 2024 NVIDIA Corporation
  Privacy Policy | Manage My Privacy | Do Not Sell or Share My Data | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact