From b5870c12d6b6ec2386dd08fc2b20b52d2dbbcb73 Mon Sep 17 00:00:00 2001 From: AlexeyAB Date: Fri, 8 May 2020 17:10:05 +0300 Subject: [PATCH] ./darknet detector valid uses letter_box=1 from cfg-file [net] letter_box=1 --- src/detector.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/detector.c b/src/detector.c index e96077c9..8eed0b7a 100644 --- a/src/detector.c +++ b/src/detector.c @@ -696,7 +696,8 @@ void validate_detector(char *datacfg, char *cfgfile, char *weightfile, char *out args.h = net.h; args.c = net.c; args.type = IMAGE_DATA; - //args.type = LETTERBOX_DATA; + const int letter_box = net.letter_box; + if (letter_box) args.type = LETTERBOX_DATA; for (t = 0; t < nthreads; ++t) { args.path = paths[i + t]; @@ -726,8 +727,7 @@ void validate_detector(char *datacfg, char *cfgfile, char *weightfile, char *out int w = val[t].w; int h = val[t].h; int nboxes = 0; - int letterbox = (args.type == LETTERBOX_DATA); - detection *dets = get_network_boxes(&net, w, h, thresh, .5, map, 0, &nboxes, letterbox); + detection *dets = get_network_boxes(&net, w, h, thresh, .5, map, 0, &nboxes, letter_box); if (nms) { if (l.nms_kind == DEFAULT_NMS) do_nms_sort(dets, nboxes, l.classes, nms); else diounms_sort(dets, nboxes, l.classes, nms, l.nms_kind, l.beta_nms);