From a720bf74e233c956e5281871ede722a2c7cf54db Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Mon, 21 May 2018 21:15:04 +0000
Subject: [PATCH] Added flag -ext_output for detector demo. Fixed proportional resize of network for random=1

---
 src/detector.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/detector.c b/src/detector.c
index f9cfdae..6150df4 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -129,9 +129,15 @@
 			//int dim = (rand() % 12 + (init_w/32 - 5)) * 32;	// +-160
             //int dim = (rand() % 4 + 16) * 32;
 			//if (get_current_batch(net)+100 > net.max_batches) dim = 544;
-			int random_val = rand() % 12;
-			int dim_w = (random_val + (init_w / 32 - 5)) * 32;	// +-160
-			int dim_h = (random_val + (init_h / 32 - 5)) * 32;	// +-160
+			
+			//int random_val = rand() % 12;
+			//int dim_w = (random_val + (init_w / 32 - 5)) * 32;	// +-160
+			//int dim_h = (random_val + (init_h / 32 - 5)) * 32;	// +-160
+
+			float random_val = rand_scale(1.4);	// *x or /x
+			int dim_w = roundl(random_val*init_w / 32) * 32;
+			int dim_h = roundl(random_val*init_h / 32) * 32;
+
 			if (dim_w < 32) dim_w = 32;
 			if (dim_h < 32) dim_h = 32;
 
@@ -1218,7 +1224,7 @@
 			if(strlen(filename) > 0)
 				if (filename[strlen(filename) - 1] == 0x0d) filename[strlen(filename) - 1] = 0;
         demo(cfg, weights, thresh, hier_thresh, cam_index, filename, names, classes, frame_skip, prefix, out_filename,
-			http_stream_port, dont_show);
+			http_stream_port, dont_show, ext_output);
     }
 	else printf(" There isn't such command: %s", argv[2]);
 }

--
Gitblit v1.10.0