TensorRT  7.2.1.6
NVIDIA TensorRT
Looking for a C++ dev who knows TensorRT?
I'm looking for work. Hire me!
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
SampleUffSSD Class Reference

The SampleUffSSD class implements the SSD sample. More...

Collaboration diagram for SampleUffSSD:

Public Member Functions

 SampleUffSSD (const SampleUffSSDParams &params)
 
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< nvuffparser::IUffParser > &parser)
 Parses an UFF 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

SampleUffSSDParams 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::ICudaEnginemEngine
 The TensorRT engine used to run the network. More...
 

Detailed Description

The SampleUffSSD class implements the SSD sample.

It creates the network using an UFF model

Member Typedef Documentation

◆ SampleUniquePtr

template<typename T >
using SampleUffSSD::SampleUniquePtr = std::unique_ptr<T, samplesCommon::InferDeleter>
private

Constructor & Destructor Documentation

◆ SampleUffSSD()

SampleUffSSD::SampleUffSSD ( const SampleUffSSDParams params)
inline

Member Function Documentation

◆ build()

bool SampleUffSSD::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 UFF model and builds the engine that will be used to run SSD (mEngine)

Returns
Returns true if the engine was created successfully and false otherwise
Here is the call graph for this function:

◆ infer()

bool SampleUffSSD::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, executes the engine and verifies the detection outputs.

Here is the call graph for this function:

◆ teardown()

bool SampleUffSSD::teardown ( )

Cleans up any state created in the sample class.

Clean up the libprotobuf files as the parsing is complete

Note
It is not safe to use any other part of the protocol buffers library after ShutdownProtobufLibrary() has been called.
Here is the call graph for this function:

◆ constructNetwork()

bool SampleUffSSD::constructNetwork ( SampleUniquePtr< nvinfer1::IBuilder > &  builder,
SampleUniquePtr< nvinfer1::INetworkDefinition > &  network,
SampleUniquePtr< nvinfer1::IBuilderConfig > &  config,
SampleUniquePtr< nvuffparser::IUffParser > &  parser 
)
private

Parses an UFF model for SSD and creates a TensorRT network.

Uses a UFF parser to create the SSD Network and marks the output layers.

Parameters
networkPointer to the network that will be populated with the SSD network
builderPointer to the engine builder
Here is the caller graph for this function:

◆ processInput()

bool SampleUffSSD::processInput ( const samplesCommon::BufferManager buffers)
private

Reads the input and mean data, preprocesses, and stores the result in a managed buffer.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ verifyOutput()

bool SampleUffSSD::verifyOutput ( const samplesCommon::BufferManager buffers)
private

Filters output detections and verify results.

Filters output detections and verify result.

Returns
whether the detection output matches expectations
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mParams

SampleUffSSDParams SampleUffSSD::mParams
private

The parameters for the sample.

◆ mInputDims

nvinfer1::Dims SampleUffSSD::mInputDims
private

The dimensions of the input to the network.

◆ mPPMs

std::vector<samplesCommon::PPM<3, 300, 300> > SampleUffSSD::mPPMs
private

PPMs of test images.

◆ mEngine

std::shared_ptr<nvinfer1::ICudaEngine> SampleUffSSD::mEngine
private

The TensorRT engine used to run the network.


The documentation for this class was generated from the following file: