mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-05-18 00:12:46 +00:00
Merge branch 'split-out-tensor-decoders' into 'main'
Draft: RFC: Split out tensor decoders from the ONNX plugin and make the Tensor meta public. See merge request gstreamer/gstreamer!6000
This commit is contained in:
commit
341d8495ab
|
@ -24,17 +24,12 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "decoders/gstssdobjectdetector.h"
|
||||
#include "gstonnxinference.h"
|
||||
#include "tensor/gsttensormeta.h"
|
||||
|
||||
static gboolean
|
||||
plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
gboolean success = GST_ELEMENT_REGISTER (ssd_object_detector, plugin);
|
||||
success |= GST_ELEMENT_REGISTER (onnx_inference, plugin);
|
||||
|
||||
return success;
|
||||
return GST_ELEMENT_REGISTER (onnx_inference, plugin);
|
||||
}
|
||||
|
||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
#define __GST_ONNX_CLIENT_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/analytics/analytics.h>
|
||||
#include <onnxruntime_cxx_api.h>
|
||||
#include <gst/video/video.h>
|
||||
#include "gstml.h"
|
||||
#include "tensor/gsttensormeta.h"
|
||||
|
||||
GST_DEBUG_CATEGORY_EXTERN (onnx_inference_debug);
|
||||
|
||||
|
|
|
@ -15,16 +15,14 @@ endif
|
|||
if onnxrt_dep.found()
|
||||
gstonnx = library('gstonnx',
|
||||
'gstonnx.c',
|
||||
'decoders/gstssdobjectdetector.c',
|
||||
'gstonnxinference.cpp',
|
||||
'gstonnxclient.cpp',
|
||||
'tensor/gsttensormeta.c',
|
||||
c_args : gst_plugins_bad_args + extra_args,
|
||||
cpp_args : gst_plugins_bad_args + extra_args,
|
||||
link_args : noseh_link_args,
|
||||
include_directories : [configinc, libsinc, cuda_stubinc],
|
||||
dependencies : [gstbase_dep, gstvideo_dep, gstanalytics_dep, onnxrt_dep,
|
||||
libm, gio_dep] + extra_deps,
|
||||
libm] + extra_deps,
|
||||
install : true,
|
||||
install_dir : plugins_install_dir,
|
||||
)
|
||||
|
|
|
@ -30,5 +30,6 @@
|
|||
#include <gst/analytics/gstanalyticsclassificationmtd.h>
|
||||
#include <gst/analytics/gstanalyticsobjectdetectionmtd.h>
|
||||
#include <gst/analytics/gstanalyticsobjecttrackingmtd.h>
|
||||
#include <gst/analytics/gsttensormeta.h>
|
||||
|
||||
#endif /* __ANALYTICS_H__ */
|
||||
|
|
|
@ -19,10 +19,16 @@
|
|||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifndef __GST_TENSOR_META_H__
|
||||
#define __GST_TENSOR_META_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/analytics/analytics-meta-prelude.h>
|
||||
|
||||
/**
|
||||
* GstTensorDataType:
|
||||
|
@ -114,9 +120,13 @@ G_BEGIN_DECLS
|
|||
#define GST_TENSOR_META_INFO \
|
||||
(gst_tensor_meta_get_info())
|
||||
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
GType gst_tensor_meta_api_get_type (void);
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
const GstMetaInfo *gst_tensor_meta_get_info (void);
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
gint gst_tensor_meta_get_index_from_id(GstTensorMeta *meta, GQuark id);
|
||||
|
||||
G_END_DECLS
|
|
@ -1,14 +1,16 @@
|
|||
analytics_sources = files( 'gstanalyticsmeta.c',
|
||||
'gstanalyticsclassificationmtd.c',
|
||||
'gstanalyticsobjectdetectionmtd.c',
|
||||
'gstanalyticsobjecttrackingmtd.c')
|
||||
'gstanalyticsobjecttrackingmtd.c',
|
||||
'gsttensormeta.c')
|
||||
|
||||
analytics_headers = files( 'analytics.h',
|
||||
'gstanalyticsmeta.h',
|
||||
'analytics-meta-prelude.h',
|
||||
'gstanalyticsclassificationmtd.h',
|
||||
'gstanalyticsobjectdetectionmtd.h',
|
||||
'gstanalyticsobjecttrackingmtd.h')
|
||||
'gstanalyticsobjecttrackingmtd.h',
|
||||
'gsttensormeta.h')
|
||||
install_headers(analytics_headers, subdir : 'gstreamer-1.0/gst/analytics')
|
||||
|
||||
pkg_name = 'gstreamer-analytics-1.0'
|
||||
|
|
|
@ -11,7 +11,7 @@ foreach plugin : ['accurip', 'adpcmdec', 'adpcmenc', 'aiff', 'asfmux',
|
|||
'mse', 'mxf', 'netsim', 'onvif', 'pcapparse', 'pnm', 'proxy',
|
||||
'rawparse', 'removesilence', 'rist', 'rtmp2', 'rtp', 'sdp',
|
||||
'segmentclip', 'siren', 'smooth', 'speed', 'subenc', 'switchbin',
|
||||
'timecode', 'transcode', 'unixfd', 'videofilters',
|
||||
'tensordecoders', 'timecode', 'transcode', 'unixfd', 'videofilters',
|
||||
'videoframe_audiolevel', 'videoparsers', 'videosignal',
|
||||
'vmnc', 'y4m']
|
||||
if not get_option(plugin).disabled()
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* GStreamer gstreamer-ssdobjectdetector
|
||||
* Copyright (C) 2021 Collabora Ltd.
|
||||
*
|
||||
* gstssdobjectdetector.cpp
|
||||
* gstssdobjectdetector.c
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
|
@ -51,7 +51,6 @@
|
|||
#include <gst/gst.h>
|
||||
#include <gst/video/video.h>
|
||||
#include <gst/analytics/analytics.h>
|
||||
#include "tensor/gsttensormeta.h"
|
||||
|
||||
/* Object detection tensor id strings */
|
||||
#define GST_MODEL_OBJECT_DETECTOR_BOXES "Gst.Model.ObjectDetector.Boxes"
|
13
subprojects/gst-plugins-bad/gst/tensordecoders/meson.build
Normal file
13
subprojects/gst-plugins-bad/gst/tensordecoders/meson.build
Normal file
|
@ -0,0 +1,13 @@
|
|||
tensordecoders_sources = [
|
||||
'gstssdobjectdetector.c'
|
||||
]
|
||||
|
||||
gsttensordecoders = library('gsttensordecoders',
|
||||
tensordecoders_sources,
|
||||
c_args : gst_plugins_bad_args,
|
||||
include_directories : [configinc],
|
||||
dependencies : [gstbase_dep, gstvideo_dep, gstanalytics_dep, gio_dep, libm],
|
||||
install : true,
|
||||
install_dir : plugins_install_dir,
|
||||
)
|
||||
plugins += [gsttensordecoders]
|
|
@ -65,6 +65,7 @@ option('smooth', type : 'feature', value : 'auto')
|
|||
option('speed', type : 'feature', value : 'auto')
|
||||
option('subenc', type : 'feature', value : 'auto')
|
||||
option('switchbin', type : 'feature', value : 'auto')
|
||||
option('tensordecoders', type : 'feature', value : 'auto')
|
||||
option('timecode', type : 'feature', value : 'auto')
|
||||
option('unixfd', type : 'feature', value : 'auto')
|
||||
option('videofilters', type : 'feature', value : 'auto')
|
||||
|
|
Loading…
Reference in a new issue