GStreamer Video Analytics (GVA) Plugin
|
Go to the documentation of this file.
17 #include "gva_audio_event_meta.h"
19 #include <gst/audio/gstaudiometa.h>
60 const char *str = g_quark_to_string(
_gst_meta->event_type);
61 return std::string(str ? str :
"");
89 throw std::invalid_argument(
"GVA::AudioEvent: name is empty");
90 GstStructure *tensor = gst_structure_new_empty(name.c_str());
91 gst_gva_audio_event_meta_add_param(
_gst_meta, tensor);
130 throw std::invalid_argument(
"GVA::AudioEvent: meta is nullptr");
132 _tensors.reserve(g_list_length(meta->params));
134 for (GList *l = meta->params; l; l = g_list_next(l)) {
135 GstStructure *s = (GstStructure *)l->data;
136 if (not gst_structure_has_name(s,
"object_id")) {
void set_label(std::string label)
Set AudioEvent label.
Definition: audio_event.h:148
AudioEvent(GstGVAAudioEventMeta *meta)
Construct AudioEvent instance from GstGVAAudioEventMeta. After this, AudioEvent will obtain all tenso...
Definition: audio_event.h:128
GstGVAAudioEventMeta * _meta() const
Internal function, don't use or use with caution.
Definition: audio_event.h:156
double confidence() const
Get confidence of detection or classification result extracted from the tensor.
Definition: tensor.h:155
int label_id() const
Get label_id from detection Tensor, last added to this AudioEvent.
Definition: audio_event.h:119
std::vector< Tensor > _tensors
vector of Tensor objects added to this AudioEvent (describing detection & inference results),...
Definition: audio_event.h:170
double confidence() const
Get AudioEvent detection confidence (set by gvaaudiodetect)
Definition: audio_event.h:68
This file contains GVA::Tensor class which contains and describes neural network inference result.
std::string label() const
Get AudioEvent label.
Definition: audio_event.h:59
Tensor detection()
Returns detection Tensor, last added to this AudioEvent. As any other Tensor, returned detection Tens...
Definition: audio_event.h:108
int label_id() const
Get label id.
Definition: tensor.h:324
Tensor * _detection
last added detection Tensor instance, defined as Tensor with name set to "detection"
Definition: audio_event.h:174
Segment< gulong > segment() const
Get Segment of AudioEvent as start and end timestamps, timestamps are presentation time.
Definition: audio_event.h:51
GstGVAAudioEventMeta * _gst_meta
GstGVAAudioEventMeta containing fields filled with detection result (produced by gvaaudiodetect eleme...
Definition: audio_event.h:165
Tensor add_tensor(const std::string &name)
Add new tensor (inference result) to this AudioEvent with name set. To add detection tensor,...
Definition: audio_event.h:87
This class represents tensor - map-like storage for inference result information, such as output blob...
Definition: tensor.h:38
This class represents audio event - object describing audio event detection result (segment) and cont...
Definition: audio_event.h:45
Template structure for audio segment containing start, end fields.
Definition: audio_event.h:33
std::vector< Tensor > tensors() const
Get all Tensor instances added to this AudioEvent.
Definition: audio_event.h:76