From 695d562918d6cd878ffe34104a9c1b518a2de740 Mon Sep 17 00:00:00 2001 From: Sergey Nuzhny Date: Tue, 17 May 2022 01:57:30 +0300 Subject: [PATCH] Fixed issues 8510 and 8511 (#8516) * Fixed issues 8510 and 8511 * Update yolo.c Return fprintf --- src/parser.c | 2 +- src/yolo.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/parser.c b/src/parser.c index 8c645e6c..09abf2d4 100644 --- a/src/parser.c +++ b/src/parser.c @@ -517,7 +517,7 @@ layer parse_yolo(list *options, size_params params) l.random = option_find_float_quiet(options, "random", 0); l.track_history_size = option_find_int_quiet(options, "track_history_size", 5); - l.sim_thresh = option_find_int_quiet(options, "sim_thresh", 0.8); + l.sim_thresh = option_find_float_quiet(options, "sim_thresh", 0.8); l.dets_for_track = option_find_int_quiet(options, "dets_for_track", 1); l.dets_for_show = option_find_int_quiet(options, "dets_for_show", 1); l.track_ciou_norm = option_find_float_quiet(options, "track_ciou_norm", 0.01); diff --git a/src/yolo.c b/src/yolo.c index dd5e2a16..44f7c5a5 100644 --- a/src/yolo.c +++ b/src/yolo.c @@ -190,7 +190,6 @@ void validate_yolo(char *cfgfile, char *weightfile) } } - if (fps) free(fps); if (val) free(val); if (val_resized) free(val_resized); if (buf) free(buf); @@ -198,10 +197,12 @@ void validate_yolo(char *cfgfile, char *weightfile) if (thr) free(thr); fprintf(stderr, "Total Detection Time: %f Seconds\n", (double)(time(0) - start)); - for(j = 0; j < classes; ++j){ - fclose(fps[j]); + if (fps) { + for(j = 0; j < classes; ++j){ + fclose(fps[j]); + } + free(fps); } - free(fps); } void validate_yolo_recall(char *cfgfile, char *weightfile)