mxpi_object2osdinstances
Function |
Converts object frames to drawing units. For example, convert MxpiObjectList to MxpiOsdInstancesList for OSD drawing. |
|---|---|
Synchronous/Asynchronous (Status) |
Asynchronous |
Constraints |
- |
Plugin Base Class (Factory) |
mxpi_object2osdinstances |
Input/Output |
Input: buffer (data type: MxpiBuffer) and metadata (data type: MxpiObjectList) Output: buffer (data type: MxpiBuffer) and metadata (data type: MxpiOsdInstancesList) |
Port Format (Caps) |
Static input: {"metadata/object"} Static output: {"metadata/osd"} |
Property |
For details, see Table 1. |
Property Name |
Description |
Mandatory or Not |
Modifiable or Not |
|---|---|---|---|
dataSource |
Index name of the input data. The default value is the key of the metadata mounted to the output port of the upstream plugin. |
No |
Yes |
colorMap |
Sets colors for object classes: "R1,G1,B1|R2,G2,B2|R3,G3,B3|...". Configuration example: 255,255,255|0,0,0|128,128,128. If the class ID is greater than the number of configured colors, the last color is used. If this property is not set, the default color table is used. |
No |
Yes |
rectThickness |
Width of the object frame. The default value is 1. The value is an integer ranging from 0 to 100. |
No |
Yes |
rectLineType |
Line type of the object frame. The value corresponds to the enumerated value of the OpenCV line type and is the same as that of fontLineType. For details, see Table 2. |
No |
Yes |
fontFace |
Font type. The value corresponds to the enumerated value of the OpenCV font type. For details, see Table 2. |
No |
Yes |
fontScale |
Font size. The default value is 1.0. The value is of the double type that ranges from 0.0 to 100.0. |
No |
Yes |
fontThickness |
Font width. The default value is 1. The value is an integer ranging from 1 to 100. |
No |
Yes |
fontLineType |
Line type of the font. The value corresponds to the enumerated value of the OpenCV line type. For details, see Table 2. |
No |
Yes |
createText |
Whether to display the classification result text of the object detection model. The value is of the Boolean type. The options are 0 (no) and 1 (yes). The default value is 1. |
No |
Yes |
Property Name |
Description |
Value |
|---|---|---|
fontFace |
FONT_HERSHEY_SIMPLEX (normal-size sans serif) |
0 (default) |
FONT_HERSHEY_PLAIN (small-size sans serif) |
1 |
|
FONT_HERSHEY_DUPLEX (normal-size sans serif, more complex than FONT_HERSHEY_SIMPLEX) |
2 |
|
FONT_HERSHEY_COMPLEX (normal-size serif) |
3 |
|
FONT_HERSHEY_TRIPLEX (normal-size serif, more complex than FONT_HERSHEY_COMPLEX) |
4 |
|
FONT_HERSHEY_COMPLEX_SMALL (smaller version of the normal-size serif) |
5 |
|
FONT_HERSHEY_SCRIPT_SIMPLEX (handwritten font) |
6 |
|
FONT_HERSHEY_SCRIPT_COMPLEX (a more complex variant of FONT_HERSHEY_SCRIPT_SIMPLEX) |
7 |
|
FONT_ITALIC (italic font) |
16 |
|
fontLineType |
LINE_4 (four connected lines) |
4 |
LINE_8 (eight connected lines) |
8 (default) |
|
LINE_AA (anti-aliasing line) |
16 |
Pipeline sample:
"mxpi_object2osdinstances0":{
"props":{
"colorMap":"100,100,100|200,200,200|0,128,255|255,128,0",
"fontFace":"16",
"fontScale":"0.5",
"fontThickness":"2",
"fontLineType":"16",
"rectThickness":"2",
"rectLineType":"16"
},
"factory":"mxpi_object2osdinstances",
"next":"queue5"
},