Difference between revisions of "GstInference/Overlay Elements/Embedding Overlay"

From RidgeRun Developer Connection
Jump to: navigation, search
m
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
{{GstInference/Head|previous=Overlay Elements/Detection Overlay|next=Crop Elements pipelines|keywords=}}
+
{{GstInference/Head|previous=Overlay Elements/Detection Overlay|next=Overlay Elements/Inference Overlay|keywords=|title=GstInference Embedding Overlay element}}
 
</noinclude>
 
</noinclude>
 
<!-- If you want a custom title for the page, un-comment and edit this line:
 
<!-- If you want a custom title for the page, un-comment and edit this line:
Line 6: Line 6:
 
-->
 
-->
  
This element consumes the classification metadata introduced in the buffer by our facenet element([[GstInference/Supported architectures/FaceNet|FaceNet]]). This metadata consist on an 128 elements array, that is filed with the embedding produced by facenet. This element draws a green border and writes "Pass" on the frame if its embedding is close to a known value or a red border and "Fail" otherwise. The element uses openCV to draw on the input frame.
+
This element consumes the classification metadata introduced in the buffer by our facenet element([[GstInference/Supported architectures/FaceNet|FaceNet]]). This element uses [[GstInference/Metadatas/GstEmbeddingMeta|GstEmbeddingMeta]]. The element uses openCV to draw on the input frame, draws a green border, and writes "Pass" on the frame if its embedding is close to a known value or a red border and "Fail" otherwise.
 
[[File:Embeddingoverlay.png|500px|center|thumb|Embedding overalay example]]
 
[[File:Embeddingoverlay.png|500px|center|thumb|Embedding overalay example]]
  
= Metadata =
+
== Properties ==
The facenet element and embedding overlay uses the same metadata as the classification plugins. GstClassificationMeta consist on the following fields:
+
The embeddingoverlay element expose the following properties to control the box's thickness, color, etc. These properties are documented in the following table:
*num_labels: The number of labels outputted by the model. This can vary from model to model. Facenet uses 128.
 
*label_probs: The embedding produced by the network.
 
 
 
If you want to access this metadata from your custom Gstreamer element instead the process is fairly easy:
 
# Add the [[GstInference/Supported architectures/FaceNet|Facenet]] element to your pipeline
 
# Include GstInference metadata header: <code>#include "gst/r2inference/gstinferencemeta.h"</code>
 
# Get a GstClassificationMeta object from the buffer: <code>class_meta = (GstClassificationMeta *) gst_buffer_get_meta (frame->buffer, GST_CLASSIFICATION_META_API_TYPE);</code>
 
 
 
FaceNet also raises a signal containing GstClassificationMeta, for details on how to use this signal please check the [[GstInference/Example_Applications | example applications]] section.
 
 
 
= Properties =
 
The embeddingoverlay element expose the following properties to control the boxes' thickness, color, etc. These properties are documented on the following table:
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 42: Line 30:
 
|}
 
|}
  
 +
== Example ==
  
 
+
For example, pipelines using embedding element please check the [[GstInference/Example_pipelines | example pipelines]] section.  
= Example =
 
 
 
For example pipelines using embedding element please check the [[GstInference/Example_pipelines | example pipelines]] section.  
 
  
 
<noinclude>
 
<noinclude>
{{GstInference/Foot|Overlay Elements/Detection Overlay|Crop Elements}}
+
{{GstInference/Foot|Overlay Elements/Detection Overlay|Overlay Elements/Inference Overlay}}
 
</noinclude>
 
</noinclude>

Latest revision as of 15:22, 22 October 2020



Previous: Overlay Elements/Detection Overlay Index Next: Overlay Elements/Inference Overlay




This element consumes the classification metadata introduced in the buffer by our facenet element(FaceNet). This element uses GstEmbeddingMeta. The element uses openCV to draw on the input frame, draws a green border, and writes "Pass" on the frame if its embedding is close to a known value or a red border and "Fail" otherwise.

Embedding overalay example

Properties

The embeddingoverlay element expose the following properties to control the box's thickness, color, etc. These properties are documented in the following table:

Property Value Description
font-scale Double [0,100] Scale of the font used on the overlay. 0 turns off the overlay
thickness Double [1,100] Thickness in pixels used for the lines
labels String Semicolon separated string containing inference labels. For example: labels="face1;face2;face3"

Example

For example, pipelines using embedding element please check the example pipelines section.


Previous: Overlay Elements/Detection Overlay Index Next: Overlay Elements/Inference Overlay