#include <numpy/arrayobject.h>
#include <glib.h>
-#include <gst/gst.h>
#include <string.h>
#include <dlfcn.h>
#include <pthread.h>
/**
* @file tensor_filter_pytorch_core.cc
* @author Parichay Kapoor <pk.kapoor@samsung.com>
- * @date 24 April 2019
+ * @date 24 April 2019
* @brief connection with pytorch libraries
* @bug No known bugs except for NYI items
*/
gst_tensors_info_copy (&outputTensorMeta, &prop->output_meta);
if (loadModel ()) {
- GST_ERROR ("Failed to load model\n");
+ g_critical ("Failed to load model\n");
return -1;
}
return 0;
auto tensor_shape = output.sizes ();
if (tensor_shape[0] != 0 && outputTensorMeta.num_tensors != tensor_shape[0]) {
- GST_ERROR ("Invalid output meta: different size");
+ g_critical ("Invalid output meta: different size");
return -1;
}
if (tensor_shape[0] == 0) {
tensor_type otype = getTensorTypeFromTorch (output.scalar_type ());
if (outputTensorMeta.info[0].type != otype) {
- GST_ERROR ("Invalid output meta: different type");
+ g_critical ("Invalid output meta: different type");
return -2;
}
goto done;
}
if (outputTensorMeta.info[i].type != otype) {
- GST_ERROR ("Invalid output meta: different type");
+ g_critical ("Invalid output meta: different type");
return -2;
}
if (num_gst_tensor != num_torch_tensor) {
- GST_ERROR ("Invalid output meta: different element size");
+ g_critical ("Invalid output meta: different element size");
return -3;
}
}
#include <glib.h>
-#include <gst/gst.h>
#include "nnstreamer_plugin_api_filter.h"
#define TENSOR_FILTER_TENSORFLOW_CORE_H
#include <glib.h>
-#include <gst/gst.h>
#include "nnstreamer_plugin_api_filter.h"
TFLiteCore::init ()
{
if (loadModel ()) {
- GST_ERROR ("Failed to load model\n");
+ g_critical ("Failed to load model\n");
return -1;
}
if (setInputTensorProp ()) {
- GST_ERROR ("Failed to initialize input tensor\n");
+ g_critical ("Failed to initialize input tensor\n");
return -2;
}
if (setOutputTensorProp ()) {
- GST_ERROR ("Failed to initialize output tensor\n");
+ g_critical ("Failed to initialize output tensor\n");
return -3;
}
return 0;
if(use_nnapi){
nnfw_delegate.reset(new ::nnfw::tflite::NNAPIDelegate);
if(nnfw_delegate->BuildGraph(interpreter.get()) != kTfLiteOk){
- GST_ERROR("Fail to BuildGraph");
+ g_critical("Fail to BuildGraph");
return -3;
}
}
for (int i = 0; i < inputTensorMeta.num_tensors; ++i) {
if (getTensorDim (input_idx_list[i], inputTensorMeta.info[i].dimension)) {
- GST_ERROR ("failed to get the dimension of input tensors");
+ g_critical ("failed to get the dimension of input tensors");
return -1;
}
inputTensorMeta.info[i].type =
for (int i = 0; i < outputTensorMeta.num_tensors; ++i) {
if (getTensorDim (output_idx_list[i], outputTensorMeta.info[i].dimension)) {
- GST_ERROR ("failed to get the dimension of output tensors");
+ g_critical ("failed to get the dimension of output tensors");
return -1;
}
outputTensorMeta.info[i].type =
#ifdef ENABLE_NNFW
if(use_nnapi){
if(nnfw_delegate->Invoke(interpreter.get()) != kTfLiteOk){
- GST_ERROR ("Failed to invoke");
+ g_critical ("Failed to invoke");
return -3;
}
}else{
if (interpreter->Invoke () != kTfLiteOk) {
- GST_ERROR ("Failed to invoke");
+ g_critical ("Failed to invoke");
return -3;
}
}
#else
if (interpreter->Invoke () != kTfLiteOk) {
- GST_ERROR ("Failed to invoke");
+ g_critical ("Failed to invoke");
return -3;
}
#endif
#define TENSOR_FILTER_TENSORFLOW_LITE_CORE_H
#include <glib.h>
-#include <gst/gst.h>
#include "nnstreamer_plugin_api_filter.h"
#include <dlfcn.h>
#include <glib.h>
#include <gmodule.h>
-#include <gst/gstinfo.h>
#include "nnstreamer_subplugin.h"
#include "nnstreamer_conf.h"
dlerror ();
handle = dlopen (fullpath, RTLD_NOW);
if (NULL == handle) {
- GST_ERROR ("Cannot dlopen %s (%s) with error %s.", name, fullpath,
+ g_critical ("Cannot dlopen %s (%s) with error %s.", name, fullpath,
dlerror ());
return NULL;
}
/* If a subplugin's constructor has called register_subplugin, skip the rest */
data = g_hash_table_lookup (table, name);
if (data == NULL) {
- GST_ERROR
+ g_critical
("nnstreamer_subplugin of %s (%s) is broken. It does not call register_subplugin with its init function.",
name, fullpath);
goto error_handle;
if (data) {
/* already exists */
- GST_ERROR ("Subplugin %s is already registered.", name);
+ g_critical ("Subplugin %s is already registered.", name);
return FALSE;
}
}
*
*/
-#include <gst/gst.h>
#include <glib.h>
#include <dlfcn.h>
*((NNStreamer_custom_class **) dlsym (ptr->handle, "NNStreamer_custom"));
dlsym_error = dlerror ();
if (dlsym_error) {
- GST_ERROR ("tensor_filter_custom:loadlib error: %s\n", dlsym_error);
+ g_critical ("tensor_filter_custom:loadlib error: %s\n", dlsym_error);
dlclose (ptr->handle);
g_free (ptr);
*private_data = NULL;