Skip to content

Commit

Permalink
Merge branch 'hotfix/fix-prediction-size-mismatch'
Browse files Browse the repository at this point in the history
  • Loading branch information
tvlenin committed Feb 10, 2020
2 parents a442f0b + 3f8e6e9 commit 7b9a138
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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.7.0.1],[https://github.com/RidgeRun/gst-inference/issues],[gst-inference])
AC_INIT([GStreamer Inference],[0.7.1.1],[https://github.com/RidgeRun/gst-inference/issues],[gst-inference])

AG_GST_INIT

Expand Down Expand Up @@ -288,7 +288,7 @@ if test "$USE_OPENCV" = "yes"; then
fi

dnl *** r2inference ***
R2INFERENCE_REQ=0.4.0
R2INFERENCE_REQ=0.4.1
AG_GST_CHECK_FEATURE(R2INFERENCE, [RidgeRun\'s Inference Framework], r2inference, [
AG_GST_PKG_CHECK_MODULES(R2INFERENCE, r2inference-0.0 >= $R2INFERENCE_REQ)
],[],[],[
Expand Down
4 changes: 2 additions & 2 deletions gst-libs/gst/r2inference/gstbackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,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 * sizeof(gfloat));
memcpy(*prediction_data, prediction->GetResultData(), *prediction_size * sizeof(gfloat));
*prediction_data = g_malloc(*prediction_size);
memcpy(*prediction_data, prediction->GetResultData(), *prediction_size);

GST_LOG_OBJECT (self, "Size of prediction %p is %lu",
*prediction_data, *prediction_size);
Expand Down
4 changes: 2 additions & 2 deletions gst-libs/gst/r2inference/gstinferencepostprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,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;
class_meta->num_labels = predsize / sizeof (gfloat);
class_meta->label_probs =
g_malloc (class_meta->num_labels * sizeof (gdouble));
for (gint i = 0; i < class_meta->num_labels; ++i) {
Expand Down Expand Up @@ -300,7 +300,7 @@ gst_create_class_from_prediction (GstVideoInference * vi,

g_return_val_if_fail (vi != NULL, NULL);

num_classes = predsize;
num_classes = predsize / sizeof (gfloat);

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

0 comments on commit 7b9a138

Please sign in to comment.