mxpi_textgenerationpostprocessor

Function

Inherits the model postprocessing base class, which is used to postprocess the output tensor of text generation (including translation, text recognition, and speech recognition) model inference.

Constraints

Currently, the upstream of the plugin can only be connected to the mxpi_tensorinfer inference plugin, and only MxpiTensorPackageList can be used as the metadata input. This plugin calls the object detection base class Process API of the mxBase repository to communicate and receive the return value of the TextsInfo data type.

Plugin Base Class (Factory)

mxpi_textgenerationpostprocessor

Input/Output

Input: buffer (data type: MxpiBuffer) and metadata (data type: MxpiTensorPackageList)

Output: buffer (data type: MxpiBuffer) and metadata (data type: MxpiTextsInfoList)

Port Format (Caps)

Static input: {"metadata/tensor"}

Static output: {"metadata/text"}

Property

For details, see Table 1.

Sample pipeline of the Python postprocessing plugin:

"mxpi_textgenerationpostprocessor0": {
	"props": {
		"dataSource": "mxpi_tensorinfer0",
                "funcLanguage":"python",
		"postProcessConfigPath": "../models/crnnms/crnn.cfg",
		"labelPath": "../models/crnnms/crnn.names",
		"postProcessLibPath": "../../../python",
                "className":"CrnnPostProcess",
                "pythonModule":"postprocess.post"
	},
	"factory": "mxpi_textgenerationpostprocessor",
	"next": "mxpi_dataserialize0"
},

Sample pipeline of the C++ postprocessing plugin:

"mxpi_textgenerationpostprocessor0": {
	"props": {
		"dataSource": "mxpi_tensorinfer0",
                "funcLanguage":"c++",
		"postProcessConfigPath": "../models/crnnms/crnn.cfg",
		"labelPath": "../models/crnnms/crnn.names",
		"postProcessLibPath": "../../../lib/modelpostprocessors/libcrnnpostprocess.so"
	},
	"factory": "mxpi_textgenerationpostprocessor",
	"next": "mxpi_dataserialize0"
},