Public Member Functions | |
const IBlobNameToTensor * | parse (const char *deploy, const char *model, nvinfer1::INetworkDefinition &network, nvinfer1::DataType weightType) override |
Parse a prototxt file and a binaryproto Caffe model to extract network definition and weights associated with the network, respectively. More... | |
const IBlobNameToTensor * | parseBuffers (const char *deployBuffer, size_t deployLength, const char *modelBuffer, size_t modelLength, nvinfer1::INetworkDefinition &network, nvinfer1::DataType weightType) override |
void | setProtobufBufferSize (size_t size) override |
Set buffer size for the parsing and storage of the learned model. More... | |
void | setPluginFactory (nvcaffeparser1::IPluginFactory *factory) override |
Set the IPluginFactory used to create the user defined plugins. More... | |
void | setPluginFactoryExt (nvcaffeparser1::IPluginFactoryExt *factory) override |
Set the IPluginFactoryExt used to create the user defined pluginExts. More... | |
void | setPluginFactoryV2 (nvcaffeparser1::IPluginFactoryV2 *factory) override |
Set the IPluginFactoryV2 used to create the user defined pluginV2 objects. More... | |
void | setPluginNamespace (const char *libNamespace) override |
Set the namespace used to lookup and create plugins in the network. More... | |
IBinaryProtoBlob * | parseBinaryProto (const char *fileName) override |
Parse and extract data stored in binaryproto file. More... | |
void | destroy () override |
Destroy this ICaffeParser object. More... | |
void | setErrorRecorder (nvinfer1::IErrorRecorder *recorder) override |
Set the ErrorRecorder for this interface. More... | |
nvinfer1::IErrorRecorder * | getErrorRecorder () const override |
get the ErrorRecorder assigned to this interface. More... | |
virtual const IBlobNameToTensor * | parseBuffers (const char *deployBuffer, std::size_t deployLength, const char *modelBuffer, std::size_t modelLength, nvinfer1::INetworkDefinition &network, nvinfer1::DataType weightType)=0 |
Parse a deploy prototxt a binaryproto Caffe model from memory buffers to extract network definition and weights associated with the network, respectively. More... | |
Private Member Functions | |
~CaffeParser () override | |
std::vector< nvinfer1::PluginField > | parseNormalizeParam (const trtcaffe::LayerParameter &msg, CaffeWeightFactory &weightFactory, BlobNameToTensor &tensors) |
std::vector< nvinfer1::PluginField > | parsePriorBoxParam (const trtcaffe::LayerParameter &msg, CaffeWeightFactory &weightFactory, BlobNameToTensor &tensors) |
std::vector< nvinfer1::PluginField > | parseDetectionOutputParam (const trtcaffe::LayerParameter &msg, CaffeWeightFactory &weightFactory, BlobNameToTensor &tensors) |
std::vector< nvinfer1::PluginField > | parseLReLUParam (const trtcaffe::LayerParameter &msg, CaffeWeightFactory &weightFactory, BlobNameToTensor &tensors) |
std::vector< nvinfer1::PluginField > | parseRPROIParam (const trtcaffe::LayerParameter &msg, CaffeWeightFactory &weightFactory, BlobNameToTensor &tensors) |
template<typename T > | |
T * | allocMemory (int size=1) |
const IBlobNameToTensor * | parse (nvinfer1::INetworkDefinition &network, nvinfer1::DataType weightType, bool hasModel) |
Private Attributes | |
std::shared_ptr< trtcaffe::NetParameter > | mDeploy |
std::shared_ptr< trtcaffe::NetParameter > | mModel |
std::vector< void * > | mTmpAllocs |
BlobNameToTensor * | mBlobNameToTensor {nullptr} |
size_t | mProtobufBufferSize {INT_MAX} |
nvcaffeparser1::IPluginFactory * | mPluginFactory {nullptr} |
nvcaffeparser1::IPluginFactoryV2 * | mPluginFactoryV2 {nullptr} |
bool | mPluginFactoryIsExt {false} |
std::vector< nvinfer1::IPluginV2 * > | mNewPlugins |
std::unordered_map< std::string, nvinfer1::IPluginCreator * > | mPluginRegistry |
std::string | mPluginNamespace = "" |
|
overrideprivate |
|
overridevirtual |
Parse a prototxt file and a binaryproto Caffe model to extract network definition and weights associated with the network, respectively.
deploy | The plain text, prototxt file used to define the network definition. |
model | The binaryproto Caffe model that contains the weights associated with the network. |
network | Network in which the CaffeParser will fill the layers. |
weightType | The type to which the weights will transformed. |
Implements nvcaffeparser1::ICaffeParser.
|
override |
|
inlineoverridevirtual |
Set buffer size for the parsing and storage of the learned model.
size | The size of the buffer specified as the number of bytes. |
Implements nvcaffeparser1::ICaffeParser.
|
inlineoverridevirtual |
Set the IPluginFactory used to create the user defined plugins.
factory | Pointer to an instance of the user implmentation of IPluginFactory. |
Implements nvcaffeparser1::ICaffeParser.
|
inlineoverridevirtual |
Set the IPluginFactoryExt used to create the user defined pluginExts.
factory | Pointer to an instance of the user implmentation of IPluginFactoryExt. |
Implements nvcaffeparser1::ICaffeParser.
|
inlineoverridevirtual |
Set the IPluginFactoryV2 used to create the user defined pluginV2 objects.
factory | Pointer to an instance of the user implmentation of IPluginFactoryV2. |
Implements nvcaffeparser1::ICaffeParser.
|
inlineoverridevirtual |
Set the namespace used to lookup and create plugins in the network.
Implements nvcaffeparser1::ICaffeParser.
|
overridevirtual |
Parse and extract data stored in binaryproto file.
The binaryproto file contains data stored in a binary blob. parseBinaryProto() converts it to an IBinaryProtoBlob object which gives the user access to the data and meta-data about data.
fileName | Path to file containing binary proto. |
Implements nvcaffeparser1::ICaffeParser.
|
inlineoverridevirtual |
Destroy this ICaffeParser object.
Implements nvcaffeparser1::ICaffeParser.
|
inlineoverridevirtual |
Set the ErrorRecorder for this interface.
Assigns the ErrorRecorder to this interface. The ErrorRecorder will track all errors during execution. This function will call incRefCount of the registered ErrorRecorder at least once. Setting recorder to nullptr unregisters the recorder with the interface, resulting in a call to decRefCount if a recorder has been registered.
recorder | The error recorder to register with this interface. |
Implements nvcaffeparser1::ICaffeParser.
|
inlineoverridevirtual |
get the ErrorRecorder assigned to this interface.
Retrieves the assigned error recorder object for the given class. A default error recorder does not exist, so a nullptr will be returned if setErrorRecorder has not been called.
Implements nvcaffeparser1::ICaffeParser.
|
private |
|
private |
|
private |
|
private |
|
private |
|
inlineprivate |
|
private |
|
pure virtualinherited |
Parse a deploy prototxt a binaryproto Caffe model from memory buffers to extract network definition and weights associated with the network, respectively.
deployBuffer | The plain text deploy prototxt used to define the network definition. |
deployLength | The length of the deploy buffer. |
modelBuffer | The binaryproto Caffe memory buffer that contains the weights associated with the network. |
modelLength | The length of the model buffer. |
network | Network in which the CaffeParser will fill the layers. |
weightType | The type to which the weights will transformed. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |