Difference between revisions of "GstInference/Metadatas/GstDetectionMeta"

From RidgeRun Developer Connection
Jump to: navigation, search
Line 11: Line 11:
 
=Fields=
 
=Fields=
 
All detection elements on GstInference use the same metadata standard. GstDetectionMeta consist on the following fields:
 
All detection elements on GstInference use the same metadata standard. GstDetectionMeta consist on the following fields:
*num_boxes: The number of boxes outputted by the model. This can vary over time.
+
 
*boxes: The array of bounding boxes.
+
{| class="wikitable" style="margin-right: 22em;"
 +
|-
 +
! field
 +
! type
 +
! description
 +
|-
 +
| num_boxes
 +
| gint
 +
| The number of boxes outputted by the model. This can vary over time.
 +
|-
 +
| boxes
 +
| BBox *
 +
| The array of bounding boxes.
 +
|}
 +
 
 
Each bounding box is an struct with:
 
Each bounding box is an struct with:
*label: The label represented
+
 
*prob: The probability of the box. Note that probability on detection works different from classification. This probability does not reflect actual probability but rather the certainty level of the neural network.
+
{| class="wikitable" style="margin-right: 22em;"
*x: X coordinate (top left corner)
+
|-
*y: Y coordinate (top left corner)
+
! field
*width: Box width
+
! type
*height: Box height
+
! description
 +
|-
 +
| label
 +
| gint
 +
| The label represented.
 +
|-
 +
| prob
 +
| gdouble
 +
| The probability of the box. Note that probability on detection works different from classification. This probability does not reflect actual probability but rather the certainty level of the neural network.
 +
|-
 +
| x
 +
| gdouble
 +
| X coordinate (top left corner)
 +
|-
 +
| y
 +
| gdouble
 +
| Y coordinate (top left corner)
 +
|-
 +
| width
 +
| gdouble
 +
| Box width
 +
|-
 +
| height
 +
| gdouble
 +
| Box height
 +
|}
  
 
=Access metadata=
 
=Access metadata=

Revision as of 13:48, 11 November 2019



Previous: Metadatas/GstEmbeddingMeta Index Next: Overlay Elements





This metadata consist on an array of bounding boxes, that were previously filtered on the detection element to remove low probability and duplicated boxes.

Fields

All detection elements on GstInference use the same metadata standard. GstDetectionMeta consist on the following fields:

field type description
num_boxes gint The number of boxes outputted by the model. This can vary over time.
boxes BBox * The array of bounding boxes.

Each bounding box is an struct with:

field type description
label gint The label represented.
prob gdouble The probability of the box. Note that probability on detection works different from classification. This probability does not reflect actual probability but rather the certainty level of the neural network.
x gdouble X coordinate (top left corner)
y gdouble Y coordinate (top left corner)
width gdouble Box width
height gdouble Box height

Access metadata

If you want to access this metadata from your custom Gstreamer element instead the process is fairly easy:

  1. Add a GstInference detection element such as TinyYoloV2 to your pipeline
  2. Include GstInference metadata header: #include "gst/r2inference/gstinferencemeta.h"
  3. Get a GstDetectionMeta object from the buffer: detect_meta = (GstDetectionMeta *) gst_buffer_get_meta (frame->buffer, GST_DETECTION_META_API_TYPE);

All GstInference detection elements also raise a signal containing GstDetectionMeta, for details on how to use this signal please check the example applications section.


Previous: Metadatas/GstEmbeddingMeta Index Next: Overlay Elements