The SampleSSD class implements the SSD sample. More...
Public Member Functions | |
SampleSSD (const SampleSSDParams ¶ms) | |
bool | build () |
Function builds the network engine. More... | |
bool | infer () |
Runs the TensorRT inference engine for this sample. More... | |
bool | teardown () |
Cleans up any state created in the sample class. More... | |
Private Types | |
template<typename T > | |
using | SampleUniquePtr = std::unique_ptr< T, samplesCommon::InferDeleter > |
Private Member Functions | |
bool | constructNetwork (SampleUniquePtr< nvinfer1::IBuilder > &builder, SampleUniquePtr< nvinfer1::INetworkDefinition > &network, SampleUniquePtr< nvinfer1::IBuilderConfig > &config, SampleUniquePtr< nvcaffeparser1::ICaffeParser > &parser) |
Parses a Caffe model for SSD and creates a TensorRT network. More... | |
bool | processInput (const samplesCommon::BufferManager &buffers) |
Reads the input and mean data, preprocesses, and stores the result in a managed buffer. More... | |
bool | verifyOutput (const samplesCommon::BufferManager &buffers) |
Filters output detections and verify results. More... | |
Private Attributes | |
SampleSSDParams | mParams |
The parameters for the sample. More... | |
nvinfer1::Dims | mInputDims |
The dimensions of the input to the network. More... | |
std::vector< samplesCommon::PPM< 3, 300, 300 > > | mPPMs |
PPMs of test images. More... | |
std::shared_ptr< nvinfer1::ICudaEngine > | mEngine |
The TensorRT engine used to run the network. More... | |
The SampleSSD class implements the SSD sample.
It creates the network using a caffe model
|
private |
|
inline |
bool SampleSSD::build | ( | ) |
Function builds the network engine.
Creates the network, configures the builder and creates the network engine.
This function creates the SSD network by parsing the caffe model and builds the engine that will be used to run SSD (mEngine)
bool SampleSSD::infer | ( | ) |
Runs the TensorRT inference engine for this sample.
This function is the main execution function of the sample. It allocates the buffer, sets inputs and executes the engine.
bool SampleSSD::teardown | ( | ) |
Cleans up any state created in the sample class.
Clean up the libprotobuf files as the parsing is complete
|
private |
Parses a Caffe model for SSD and creates a TensorRT network.
Uses a caffe parser to create the SSD Network and marks the output layers.
network | Pointer to the network that will be populated with the SSD network |
builder | Pointer to the engine builder |
|
private |
Reads the input and mean data, preprocesses, and stores the result in a managed buffer.
|
private |
Filters output detections and verify results.
Filters output detections and verify result.
|
private |
The parameters for the sample.
|
private |
The dimensions of the input to the network.
|
private |
PPMs of test images.
|
private |
The TensorRT engine used to run the network.