Element to use general neural network framework directly without gstreamer pipeline. More...
#include <glib.h>
#include <string.h>
#include "nnstreamer_log.h"
#include "tensor_filter_common.h"
#include "tensor_filter_single.h"
Go to the source code of this file.
Classes | |
struct | _GTensorFilterSinglePrivate |
Private data struct for tensor-filter single class. More... | |
Macros | |
#define | G_TENSOR_FILTER_SINGLE_PRIV(obj) ((GTensorFilterSinglePrivate *) (obj)->priv) |
#define | g_tensor_filter_single_parent_class parent_class |
Typedefs | |
typedef struct _GTensorFilterSinglePrivate | GTensorFilterSinglePrivate |
Private data struct for tensor-filter single class. More... | |
Functions | |
G_DEFINE_TYPE_WITH_PRIVATE (GTensorFilterSingle, g_tensor_filter_single, G_TYPE_OBJECT) | |
static void | g_tensor_filter_single_finalize (GObject *object) |
Function to finalize instance. More... | |
static void | g_tensor_filter_single_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
Setter for tensor_filter_single properties. More... | |
static void | g_tensor_filter_single_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) |
Getter for tensor_filter_single properties. More... | |
static gboolean | g_tensor_filter_single_invoke (GTensorFilterSingle *self, const GstTensorMemory *input, GstTensorMemory *output, gboolean allocate) |
Called when an input supposed to be invoked. More... | |
static gboolean | g_tensor_filter_input_configured (GTensorFilterSingle *self) |
Determine if input is configured (both input and output tensor) More... | |
static gboolean | g_tensor_filter_output_configured (GTensorFilterSingle *self) |
Determine if output is configured (both input and output tensor) More... | |
static gint | g_tensor_filter_set_input_info (GTensorFilterSingle *self, const GstTensorsInfo *in_info, GstTensorsInfo *out_info) |
Set input tensor information in the framework. More... | |
static void | g_tensor_filter_destroy_notify (GTensorFilterSingle *self, GstTensorMemory *mem) |
Called to notify the framework to destroy the allocated memory. More... | |
static gboolean | g_tensor_filter_allocate_in_invoke (GTensorFilterSingle *self) |
Determine if this filter framework supports allocation in invoke. More... | |
static gboolean | g_tensor_filter_single_start (GTensorFilterSingle *self) |
Called when the element starts processing, if fw not loaded. More... | |
static gboolean | g_tensor_filter_single_stop (GTensorFilterSingle *self) |
Called when the element stops processing, if fw loaded. More... | |
static void | g_tensor_filter_single_class_init (GTensorFilterSingleClass *klass) |
initialize the tensor_filter's class More... | |
static void | g_tensor_filter_single_init (GTensorFilterSingle *self) |
initialize the new element More... | |
Element to use general neural network framework directly without gstreamer pipeline.
Copyright (C) 2019 Parichay Kapoor pk.ka poor @sams ung. com
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; version 2.1 of the License.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
This is the main element for per-NN-framework plugins. Specific implementations for each NN framework must be written in each framework specific files; e.g., tensor_filter_tensorflow_lite.c
Definition in file tensor_filter_single.c.
#define g_tensor_filter_single_parent_class parent_class |
Definition at line 61 of file tensor_filter_single.c.
#define G_TENSOR_FILTER_SINGLE_PRIV | ( | obj | ) | ((GTensorFilterSinglePrivate *) (obj)->priv) |
Definition at line 59 of file tensor_filter_single.c.
typedef struct _GTensorFilterSinglePrivate GTensorFilterSinglePrivate |
Private data struct for tensor-filter single class.
SECTION:element-tensor_filter_single
An element that invokes neural network models and their framework or an independent shared object implementing tensor_filter_custom.h. The input and output are always in the format of other/tensor or other/tensors. This element is going to be the basis of single shot api.
G_DEFINE_TYPE_WITH_PRIVATE | ( | GTensorFilterSingle | , |
g_tensor_filter_single | , | ||
G_TYPE_OBJECT | |||
) |
|
inlinestatic |
Determine if this filter framework supports allocation in invoke.
Definition at line 231 of file tensor_filter_single.c.
|
static |
Called to notify the framework to destroy the allocated memory.
self | "this" pointer |
mem | Memory wrapper for the allocated memory by the filter |
Definition at line 296 of file tensor_filter_single.c.
|
static |
Determine if input is configured (both input and output tensor)
Definition at line 200 of file tensor_filter_single.c.
|
static |
Determine if output is configured (both input and output tensor)
Definition at line 216 of file tensor_filter_single.c.
|
static |
Set input tensor information in the framework.
self | "this" pointer |
in_info | information on the input tensor |
out_info | updated information on the output tensor |
Definition at line 400 of file tensor_filter_single.c.
|
static |
initialize the tensor_filter's class
Definition at line 89 of file tensor_filter_single.c.
|
static |
Function to finalize instance.
stop if not already stopped
Definition at line 133 of file tensor_filter_single.c.
|
static |
Getter for tensor_filter_single properties.
Definition at line 178 of file tensor_filter_single.c.
|
static |
initialize the new element
Definition at line 115 of file tensor_filter_single.c.
|
static |
Called when an input supposed to be invoked.
self | "this" pointer |
input | memory containing input data to run processing on |
output | memory to put output data into after processing |
allocate | true to allocate output data (false means tensor data is already allocated) |
start if not already started
Definition at line 321 of file tensor_filter_single.c.
|
static |
Setter for tensor_filter_single properties.
Definition at line 157 of file tensor_filter_single.c.
|
static |
Called when the element starts processing, if fw not loaded.
self | "this" pointer |
open framework, load model
Definition at line 246 of file tensor_filter_single.c.
|
static |
Called when the element stops processing, if fw loaded.
self | "this" pointer |
close framework, unload model
Definition at line 277 of file tensor_filter_single.c.