Skip to content

Commit 7b9a138

Browse files
committed
Merge branch 'hotfix/fix-prediction-size-mismatch'
2 parents a442f0b + 3f8e6e9 commit 7b9a138

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

configure.ac

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dnl please read gstreamer/docs/random/autotools before changing this file
55
dnl initialize autoconf
66
dnl releases only do -Wall, git and prerelease does -Werror too
77
dnl use a three digit version number for releases, and four for git/pre
8-
AC_INIT([GStreamer Inference],[0.7.0.1],[https://github.com/RidgeRun/gst-inference/issues],[gst-inference])
8+
AC_INIT([GStreamer Inference],[0.7.1.1],[https://github.com/RidgeRun/gst-inference/issues],[gst-inference])
99

1010
AG_GST_INIT
1111

@@ -288,7 +288,7 @@ if test "$USE_OPENCV" = "yes"; then
288288
fi
289289

290290
dnl *** r2inference ***
291-
R2INFERENCE_REQ=0.4.0
291+
R2INFERENCE_REQ=0.4.1
292292
AG_GST_CHECK_FEATURE(R2INFERENCE, [RidgeRun\'s Inference Framework], r2inference, [
293293
AG_GST_PKG_CHECK_MODULES(R2INFERENCE, r2inference-0.0 >= $R2INFERENCE_REQ)
294294
],[],[],[

gst-libs/gst/r2inference/gstbackend.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,8 @@ gst_backend_process_frame (GstBackend *self, GstVideoFrame *input_frame,
454454
*prediction_size = prediction->GetResultSize ();
455455

456456
/*could we avoid memory copy ?*/
457-
*prediction_data = g_malloc(*prediction_size * sizeof(gfloat));
458-
memcpy(*prediction_data, prediction->GetResultData(), *prediction_size * sizeof(gfloat));
457+
*prediction_data = g_malloc(*prediction_size);
458+
memcpy(*prediction_data, prediction->GetResultData(), *prediction_size);
459459

460460
GST_LOG_OBJECT (self, "Size of prediction %p is %lu",
461461
*prediction_data, *prediction_size);

gst-libs/gst/r2inference/gstinferencepostprocess.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ gst_fill_classification_meta (GstClassificationMeta * class_meta,
5151
g_return_val_if_fail (class_meta != NULL, FALSE);
5252
g_return_val_if_fail (prediction != NULL, FALSE);
5353

54-
class_meta->num_labels = predsize;
54+
class_meta->num_labels = predsize / sizeof (gfloat);
5555
class_meta->label_probs =
5656
g_malloc (class_meta->num_labels * sizeof (gdouble));
5757
for (gint i = 0; i < class_meta->num_labels; ++i) {
@@ -300,7 +300,7 @@ gst_create_class_from_prediction (GstVideoInference * vi,
300300

301301
g_return_val_if_fail (vi != NULL, NULL);
302302

303-
num_classes = predsize;
303+
num_classes = predsize / sizeof (gfloat);
304304

305305
/* FIXME: This is just dumb */
306306
if (sizeof (gfloat) != sizeof (gdouble)) {

0 commit comments

Comments
 (0)