Helper class to build models and generate the TensorRT ICudaEngine required for inference.
This class will parse models using the nvdsinfer::IModelParser interface and then build the model engine using nvinfer1::IBuilder's BuilderConfig APIs based on initialization parameters passed to NvDsInferContext. Alternatively, this class can also deserialize an existing serialized engine to generate the ICudaEngine.
Definition at line 316 of file nvdsinfer_model_builder.h.
Public Member Functions | |
| TrtModelBuilder (int gpuId, nvinfer1::ILogger &logger, const std::shared_ptr< DlLibHandle > &dlHandle=nullptr) | |
| ~TrtModelBuilder () | |
| void | setInt8Calibrator (std::unique_ptr< nvinfer1::IInt8Calibrator > &&calibrator) |
| std::unique_ptr< TrtEngine > | buildModel (const NvDsInferContextInitParams &initParams, std::string &suggestedPathName) |
| std::unique_ptr< TrtEngine > | buildEngine (nvinfer1::INetworkDefinition &network, BuildParams &options) |
| NvDsInferStatus | serializeEngine (const std::string &path, nvinfer1::ICudaEngine &engine) |
| std::unique_ptr< TrtEngine > | deserializeEngine (const std::string &path, int dla=-1) |
Friends | |
| class | BuildParams |
| class | ImplicitBuildParams |
| class | ExplicitBuildParams |
| nvdsinfer::TrtModelBuilder::TrtModelBuilder | ( | int | gpuId, |
| nvinfer1::ILogger & | logger, | ||
| const std::shared_ptr< DlLibHandle > & | dlHandle = nullptr |
||
| ) |
|
inline |
Definition at line 322 of file nvdsinfer_model_builder.h.
| std::unique_ptr<TrtEngine> nvdsinfer::TrtModelBuilder::buildEngine | ( | nvinfer1::INetworkDefinition & | network, |
| BuildParams & | options | ||
| ) |
| std::unique_ptr<TrtEngine> nvdsinfer::TrtModelBuilder::buildModel | ( | const NvDsInferContextInitParams & | initParams, |
| std::string & | suggestedPathName | ||
| ) |
| std::unique_ptr<TrtEngine> nvdsinfer::TrtModelBuilder::deserializeEngine | ( | const std::string & | path, |
| int | dla = -1 |
||
| ) |
| NvDsInferStatus nvdsinfer::TrtModelBuilder::serializeEngine | ( | const std::string & | path, |
| nvinfer1::ICudaEngine & | engine | ||
| ) |
|
inline |
Definition at line 326 of file nvdsinfer_model_builder.h.
|
friend |
Definition at line 403 of file nvdsinfer_model_builder.h.
|
friend |
Definition at line 405 of file nvdsinfer_model_builder.h.
|
friend |
Definition at line 404 of file nvdsinfer_model_builder.h.