From 1b20c3a5b4f8a1dcf457273a905c7df25818c7e6 Mon Sep 17 00:00:00 2001 From: tvlenin Date: Thu, 6 Feb 2020 10:05:52 -0600 Subject: [PATCH 1/2] Use the correct size for predictions --- gst-libs/gst/r2inference/gstbackend.cc | 4 ++-- gst-libs/gst/r2inference/gstinferencepostprocess.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/r2inference/gstbackend.cc b/gst-libs/gst/r2inference/gstbackend.cc index 48f088db..633957b2 100644 --- a/gst-libs/gst/r2inference/gstbackend.cc +++ b/gst-libs/gst/r2inference/gstbackend.cc @@ -432,8 +432,8 @@ gst_backend_process_frame (GstBackend *self, GstVideoFrame *input_frame, *prediction_size = prediction->GetResultSize (); /*could we avoid memory copy ?*/ - *prediction_data = g_malloc(*prediction_size); - memcpy(*prediction_data, prediction->GetResultData(), *prediction_size); + *prediction_data = g_malloc(*prediction_size * sizeof(gfloat)); + memcpy(*prediction_data, prediction->GetResultData(), *prediction_size * sizeof(gfloat)); GST_LOG_OBJECT (self, "Size of prediction %p is %lu", *prediction_data, *prediction_size); diff --git a/gst-libs/gst/r2inference/gstinferencepostprocess.c b/gst-libs/gst/r2inference/gstinferencepostprocess.c index 576f5edf..baebb32e 100644 --- a/gst-libs/gst/r2inference/gstinferencepostprocess.c +++ b/gst-libs/gst/r2inference/gstinferencepostprocess.c @@ -48,7 +48,7 @@ gst_fill_classification_meta (GstClassificationMeta * class_meta, g_return_val_if_fail (class_meta != NULL, FALSE); g_return_val_if_fail (prediction != NULL, FALSE); - class_meta->num_labels = predsize / sizeof (gfloat); + class_meta->num_labels = predsize; class_meta->label_probs = g_malloc (class_meta->num_labels * sizeof (gdouble)); for (gint i = 0; i < class_meta->num_labels; ++i) { From d851d3032f031f177f6bc31077b8a60a6e241b58 Mon Sep 17 00:00:00 2001 From: tvlenin Date: Thu, 6 Feb 2020 10:17:52 -0600 Subject: [PATCH 2/2] Increase version number --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index cf188648..d5441457 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ dnl please read gstreamer/docs/random/autotools before changing this file dnl initialize autoconf dnl releases only do -Wall, git and prerelease does -Werror too dnl use a three digit version number for releases, and four for git/pre -AC_INIT([GStreamer Inference],[0.6.0.1],[https://github.com/RidgeRun/gst-inference/issues],[gst-inference]) +AC_INIT([GStreamer Inference],[0.6.1.1],[https://github.com/RidgeRun/gst-inference/issues],[gst-inference]) AG_GST_INIT