The vvas_xinfer plugin loads a postprocess shared library at runtime to
decode inference output tensors into structured results (classifications,
detections). The library is specified by the library-path field inside the
postprocess-config JSON object, and library-specific options are passed
through the library-config JSON object.
Three reference postprocess libraries are shipped as source under
vvas-gst-plugins/sys/infer/vvas_postprocess_models/ in the vvas
repository. They are built as standalone shared libraries and installed to
/usr/lib/ on the target.
Library |
Model Type |
Source File |
|---|---|---|
|
Classification |
|
|
Classification |
|
|
Detection (YOLO family) |
|
Classification: ResNet50 / ResNet18
Both libraries perform ImageNet-style top-k classification on a single output tensor with 1000 logits. They support INT8 (auto-dequantized), FP32, BF16, and FP16 tensor data types.
Key |
Type |
Default |
Description |
|---|---|---|---|
|
int |
1 |
Number of top-scoring classes to return. |
|
string |
(required) |
Path to a text file with one class label per line (1000 lines for ImageNet). Initialization fails if the file is missing or unreadable. |
|
bool |
false |
Skip the softmax computation before top-k selection. Use this when the model already outputs probabilities. ResNet50 only – the ResNet18 library always applies softmax and does not recognize this field. |
Example library-config for ResNet50:
{
"library-config": {
"topk": 5,
"label-file-path": "/usr/share/vvas/resnet50/labels.txt",
"disable-softmax": false
}
}
Detection: YOLO Family
The YOLO postprocess library decodes bounding-box predictions from a single output tensor and applies Non-Maximum Suppression (NMS). It supports both anchor-based models (YOLOv3, YOLOv5) and anchor-free models (YOLOv8 and later).
YOLO Output Tensor Layout
Anchor-based models (YOLOv3/v5) produce predictions with the layout
[num_predictions, 5 + num_classes] where attribute index 4 is the
objectness score. The final detection confidence is
objectness * class_probability.
Anchor-free models (YOLOv8+) produce predictions with the layout
[num_predictions, 4 + num_classes]. There is no objectness score; the
class score is used directly as the detection confidence.
The library auto-detects whether the tensor is transposed
([attributes, predictions] vs [predictions, attributes]) from the
tensor shape. No configuration is needed for this.
Key |
Type |
Default |
Description |
|---|---|---|---|
|
float |
0.25 |
Minimum confidence score to keep a candidate detection. Must be finite
and in the range |
|
float |
0.45 |
IoU (Intersection over Union) threshold for NMS. Overlapping boxes
above this threshold are suppressed. Must be finite and in the range
|
|
string |
(empty) |
Apply defaults for a known YOLO model family. Supported families are
|
|
bool |
Preset-dependent |
Set to |
|
bool |
Preset-dependent |
Apply sigmoid activation to raw objectness and class scores before thresholding. Enable when the model outputs raw logits instead of probabilities. |
|
bool |
false |
When |
|
bool |
false |
When |
|
int |
300 |
Maximum number of detections returned after NMS. Must be a positive integer. |
|
bool |
Preset-dependent |
Enable grid-based box decoding with stride offsets. Required for models
whose output tensor contains raw grid-relative predictions. When
enabled, the library applies |
|
int |
1 |
Number of predictions per grid cell. Only used when |
|
int array |
|
Strides used to generate grid locations when |
|
int |
640 |
Model input width used for grid generation when |
|
int |
640 |
Model input height used for grid generation when |
|
string |
(empty) |
Path to a text file with one class label per line (lines starting with
|
|
int |
(system default) |
VVAS log level for the postprocess library. |
YOLO Presets
Preset names are case-insensitive. The v after yolo is optional, so
yolov5, yolo5, YOLOv5, and yoloV5 select the same preset.
After a preset is applied, any explicitly configured field overrides the preset
default.
Preset family |
Defaults |
|---|---|
|
|
|
|
|
|
Example library-config for YOLOv5:
{
"library-config": {
"preset": "yolov5",
"conf_thresh": 0.25,
"iou_thresh": 0.45,
"class_label_file": "/usr/share/vvas/yolo/coco.names"
}
}
Example library-config for YOLOv8:
{
"library-config": {
"preset": "yolov8",
"conf_thresh": 0.25,
"iou_thresh": 0.45,
"class_label_file": "/usr/share/vvas/yolo/coco.names"
}
}
Example library-config for YOLOX grid decode:
{
"library-config": {
"preset": "yolox",
"conf_thresh": 0.35,
"iou_thresh": 0.30,
"input_width": 640,
"input_height": 640,
"grid_strides": [8, 16, 32],
"class_label_file": "/usr/share/vvas/yolo/coco.names"
}
}
Practical Guidance
Set
has_objectness_scorebased on model architecture, not the model’s internal precision (INT8/FP16/FP32). Mixed-precision compiled models still follow the same output layout as their architecture defines.For YOLOv8 and later anchor-free models, set
has_objectness_scoretofalseandbox_grid_decodetofalse.For YOLOv3/v5 anchor-based models, set
has_objectness_scoretotrue. Enablebox_grid_decodeonly if the model outputs raw grid-relative predictions.If using a YOLO preset, remember that explicitly configured JSON fields override the preset defaults.
When
box_grid_decodeistrue, configureinput_width,input_height,grid_strides, andpreds_per_locationso the generated grid count matches the model’s prediction count. For example, a P6 model may use[8, 16, 32, 64], and a P2-P5 model may use[4, 8, 16, 32].INT8 tensors are automatically dequantized using the scale coefficient from the tensor info provided by the inference engine.
Adding a Custom Postprocess Library
To create a postprocess library for a model not covered by the reference implementations, see Adding New Postprocessing Implementation to VvasPostprocess.