28 nvinfer1::INetworkDefinition *network, nvinfer1::IBuilder *builder, nvinfer1::IBuilderConfig *config,
int batchSize
31 nvinfer1::IOptimizationProfile* profile = builder->createOptimizationProfile();
33 nvinfer1::ITensor* input = network->getInput(1);
34 const char* inputNamePts = input->getName();
35 profile->setDimensions(inputNamePts, nvinfer1::OptProfileSelector::kMIN, nvinfer1::Dims3(1, 1, 2));
36 profile->setDimensions(inputNamePts, nvinfer1::OptProfileSelector::kOPT, nvinfer1::Dims3(1, 1, 2));
37 profile->setDimensions(inputNamePts, nvinfer1::OptProfileSelector::kMAX, nvinfer1::Dims3(1, 10, 2));
39 input = network->getInput(2);
40 const char* inputNamePtLabels = input->getName();
41 profile->setDimensions(inputNamePtLabels, nvinfer1::OptProfileSelector::kMIN, nvinfer1::Dims2(1, 1));
42 profile->setDimensions(inputNamePtLabels, nvinfer1::OptProfileSelector::kOPT, nvinfer1::Dims2(1, 1));
43 profile->setDimensions(inputNamePtLabels, nvinfer1::OptProfileSelector::kMAX, nvinfer1::Dims2(1, 10));
45 config->addOptimizationProfile(profile);
56 trtModule->
m_context->setInputShape(trtModule->
m_engine->getIOTensorName(1), nvinfer1::Dims3(1, 2, 2));
57 trtModule->
m_context->setInputShape(trtModule->
m_engine->getIOTensorName(2), nvinfer1::Dims2(1, 2));
68 nvinfer1::INetworkDefinition *network, nvinfer1::IBuilder *builder, nvinfer1::IBuilderConfig *config,
int batchSize
71 nvinfer1::IOptimizationProfile* profile = builder->createOptimizationProfile();
73 nvinfer1::ITensor* input = network->getInput(0);
75 const char* inputName = input->getName();
76 nvinfer1::Dims inputDim = input->getDimensions();
78 profile->setDimensions(inputName, nvinfer1::OptProfileSelector::kMIN, inputDim);
79 inputDim.d[0] = batchSize;
80 profile->setDimensions(inputName, nvinfer1::OptProfileSelector::kOPT, inputDim);
81 profile->setDimensions(inputName, nvinfer1::OptProfileSelector::kMAX, inputDim);
83 config->addOptimizationProfile(profile);
93 for (
int ind = 0; ind < trtModule->
m_engine->getNbIOTensors(); ++ind)
95 if (trtModule->
m_engine->getTensorIOMode(trtModule->
m_engine->getIOTensorName(ind)) == nvinfer1::TensorIOMode::kINPUT)
97 nvinfer1::Dims lastInputDims = trtModule->
m_context->getTensorShape(
98 trtModule->
m_engine->getIOTensorName(ind)
100 lastInputDims.d[0] = 1;
101 trtModule->
m_context->setInputShape(trtModule->
m_engine->getIOTensorName(ind), lastInputDims);
114 nvinfer1::INetworkDefinition *network, nvinfer1::IBuilder *builder, nvinfer1::IBuilderConfig *config,
int batchSize
117 nvinfer1::IOptimizationProfile* profile = builder->createOptimizationProfile();
118 int maxPointNum = batchSize * 2;
119 nvinfer1::ITensor* input = network->getInput(1);
120 const char* inputNamePts = input->getName();
121 profile->setDimensions(inputNamePts, nvinfer1::OptProfileSelector::kMIN, nvinfer1::Dims2(1, 2 * 2));
122 profile->setDimensions(inputNamePts, nvinfer1::OptProfileSelector::kOPT, nvinfer1::Dims2(1, maxPointNum * 2));
123 profile->setDimensions(inputNamePts, nvinfer1::OptProfileSelector::kMAX, nvinfer1::Dims2(1, maxPointNum * 2));
125 input = network->getInput(2);
126 const char* inputNamePtLabels = input->getName();
127 profile->setDimensions(inputNamePtLabels, nvinfer1::OptProfileSelector::kMIN, nvinfer1::Dims2(1, 2));
128 profile->setDimensions(inputNamePtLabels, nvinfer1::OptProfileSelector::kOPT, nvinfer1::Dims2(1, maxPointNum));
129 profile->setDimensions(inputNamePtLabels, nvinfer1::OptProfileSelector::kMAX, nvinfer1::Dims2(1, maxPointNum));
131 config->addOptimizationProfile(profile);
142 trtModule->
m_context->setInputShape(trtModule->
m_engine->getIOTensorName(1), nvinfer1::Dims2(1, 2 * 2));
143 trtModule->
m_context->setInputShape(trtModule->
m_engine->getIOTensorName(2), nvinfer1::Dims2(1, 2));
154 nvinfer1::INetworkDefinition *network, nvinfer1::IBuilder *builder, nvinfer1::IBuilderConfig *config,
int batchSize
157 nvinfer1::IOptimizationProfile* profile = builder->createOptimizationProfile();
159 nvinfer1::ITensor* input = network->getInput(0);
160 const char* inputNamePts = input->getName();
161 profile->setDimensions(inputNamePts, nvinfer1::OptProfileSelector::kMIN, nvinfer1::Dims3(1, 1, 2));
162 profile->setDimensions(inputNamePts, nvinfer1::OptProfileSelector::kOPT, nvinfer1::Dims3(batchSize, 2, 2));
163 profile->setDimensions(inputNamePts, nvinfer1::OptProfileSelector::kMAX, nvinfer1::Dims3(batchSize, 2, 2));
165 input = network->getInput(1);
166 const char* inputNamePtLabels = input->getName();
167 profile->setDimensions(inputNamePtLabels, nvinfer1::OptProfileSelector::kMIN, nvinfer1::Dims2(1, 1));
168 profile->setDimensions(inputNamePtLabels, nvinfer1::OptProfileSelector::kOPT, nvinfer1::Dims2(batchSize, 2));
169 profile->setDimensions(inputNamePtLabels, nvinfer1::OptProfileSelector::kMAX, nvinfer1::Dims2(batchSize, 2));
171 input = network->getInput(2);
172 const char* inputNamePixFeatWithMem = input->getName();
173 profile->setDimensions(
174 inputNamePixFeatWithMem, nvinfer1::OptProfileSelector::kMIN, nvinfer1::Dims4(1, 256, 64, 64)
176 profile->setDimensions(
177 inputNamePixFeatWithMem, nvinfer1::OptProfileSelector::kOPT, nvinfer1::Dims4(batchSize, 256, 64, 64)
179 profile->setDimensions(
180 inputNamePixFeatWithMem, nvinfer1::OptProfileSelector::kMAX, nvinfer1::Dims4(batchSize, 256, 64, 64)
183 config->addOptimizationProfile(profile);
193 int pointNum = sizes.at(0);
194 int batchSize = (sizes.size() >= 2) ? sizes.at(1) : 1;
197 trtModule->
m_engine->getIOTensorName(0), nvinfer1::Dims3(batchSize, pointNum, 2)
199 trtModule->
m_context->setInputShape(trtModule->
m_engine->getIOTensorName(1), nvinfer1::Dims2(batchSize, pointNum));
201 trtModule->
m_engine->getIOTensorName(2), nvinfer1::Dims4(batchSize, 256, 64, 64)
213 nvinfer1::INetworkDefinition *network, nvinfer1::IBuilder *builder, nvinfer1::IBuilderConfig *config,
int batchSize
216 nvinfer1::IOptimizationProfile* profile = builder->createOptimizationProfile();
217 int numObjPtr = 16, numMaskMem = 7;
219 nvinfer1::ITensor* input = network->getInput(2);
220 const char* inputName2 = input->getName();
221 profile->setDimensions(inputName2, nvinfer1::OptProfileSelector::kMIN, nvinfer1::Dims3(1, 1, 256));
222 profile->setDimensions(inputName2, nvinfer1::OptProfileSelector::kOPT, nvinfer1::Dims3(batchSize, numObjPtr, 256));
223 profile->setDimensions(inputName2, nvinfer1::OptProfileSelector::kMAX, nvinfer1::Dims3(batchSize, numObjPtr, 256));
226 input = network->getInput(3);
227 const char* inputName3 = input->getName();
228 nvinfer1::Dims inputDim = {5, {1,1,64,64,64}};
229 profile->setDimensions(inputName3, nvinfer1::OptProfileSelector::kMIN, inputDim);
230 inputDim.d[0] = batchSize, inputDim.d[1] = numMaskMem;
231 profile->setDimensions(inputName3, nvinfer1::OptProfileSelector::kOPT, inputDim);
232 inputDim.d[0] = batchSize, inputDim.d[1] = numMaskMem;
233 profile->setDimensions(inputName3, nvinfer1::OptProfileSelector::kMAX, inputDim);
237 input = network->getInput(4);
238 const char* inputName4 = input->getName();
239 profile->setDimensions(inputName4, nvinfer1::OptProfileSelector::kMIN, nvinfer1::Dims3(1, 4100, 64));
240 profile->setDimensions(
241 inputName4, nvinfer1::OptProfileSelector::kOPT, nvinfer1::Dims3(batchSize, numMaskMem*4096 + 4*numObjPtr, 64)
243 profile->setDimensions(
244 inputName4, nvinfer1::OptProfileSelector::kMAX, nvinfer1::Dims3(batchSize, numMaskMem*4096 + 4*numObjPtr, 64)
247 config->addOptimizationProfile(profile);
257 int batchSize = sizes.at(0), numObjPtrs = sizes.at(1), numMaskMem = sizes.at(2), numFrames = sizes.at(3);
260 trtModule->
m_engine->getIOTensorName(2), nvinfer1::Dims3(batchSize, numObjPtrs, 256)
262 nvinfer1::Dims inputDim = {5, {batchSize,numMaskMem,64,64,64}};
263 trtModule->
m_context->setInputShape(trtModule->
m_engine->getIOTensorName(3), inputDim);
265 trtModule->
m_engine->getIOTensorName(4), nvinfer1::Dims3(batchSize, numMaskMem*4096 + 4*numFrames, 64)
277 nvinfer1::INetworkDefinition *network, nvinfer1::IBuilder *builder, nvinfer1::IBuilderConfig *config,
int batchSize
280 nvinfer1::IOptimizationProfile* profile = builder->createOptimizationProfile();
282 nvinfer1::ITensor* input = network->getInput(0);
283 const char* inputNameMaskForMem = input->getName();
284 profile->setDimensions(inputNameMaskForMem, nvinfer1::OptProfileSelector::kMIN, nvinfer1::Dims4(1, 1, 1024, 1024));
285 profile->setDimensions(
286 inputNameMaskForMem, nvinfer1::OptProfileSelector::kOPT, nvinfer1::Dims4(batchSize, 1, 1024, 1024)
288 profile->setDimensions(
289 inputNameMaskForMem, nvinfer1::OptProfileSelector::kMAX, nvinfer1::Dims4(batchSize, 1, 1024, 1024)
292 input = network->getInput(2);
293 const char* inputNameOccLogit = input->getName();
294 profile->setDimensions(inputNameOccLogit, nvinfer1::OptProfileSelector::kMIN, nvinfer1::Dims2(1, 1));
295 profile->setDimensions(inputNameOccLogit, nvinfer1::OptProfileSelector::kOPT, nvinfer1::Dims2(batchSize, 1));
296 profile->setDimensions(inputNameOccLogit, nvinfer1::OptProfileSelector::kMAX, nvinfer1::Dims2(batchSize, 1));
297 config->addOptimizationProfile(profile);
307 int batchSize = sizes.at(0);
310 trtModule->
m_engine->getIOTensorName(0), nvinfer1::Dims4(batchSize, 1, 1024, 1024)
312 trtModule->
m_context->setInputShape(trtModule->
m_engine->getIOTensorName(2), nvinfer1::Dims2(batchSize, 1));