From ae9fb2abbd8e2b7e079b56bf1cf39754d7c091ac Mon Sep 17 00:00:00 2001
From: Nadeen Udantha <udanthan@gmail.com>
Date: Fri, 18 May 2018 08:49:19 +0000
Subject: [PATCH] ojbects -> objects

---
 src/detector.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/detector.c b/src/detector.c
index 2b54a4a..b7fbfbd 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -21,10 +21,10 @@
 
 #ifndef CV_VERSION_EPOCH
 #include "opencv2/videoio/videoio_c.h"
-#define OPENCV_VERSION CVAUX_STR(CV_VERSION_MAJOR)""CVAUX_STR(CV_VERSION_MINOR)""CVAUX_STR(CV_VERSION_REVISION)
+#define OPENCV_VERSION CVAUX_STR(CV_VERSION_MAJOR)"" CVAUX_STR(CV_VERSION_MINOR)"" CVAUX_STR(CV_VERSION_REVISION)
 #pragma comment(lib, "opencv_world" OPENCV_VERSION ".lib")
 #else
-#define OPENCV_VERSION CVAUX_STR(CV_VERSION_EPOCH)""CVAUX_STR(CV_VERSION_MAJOR)""CVAUX_STR(CV_VERSION_MINOR)
+#define OPENCV_VERSION CVAUX_STR(CV_VERSION_EPOCH)"" CVAUX_STR(CV_VERSION_MAJOR)"" CVAUX_STR(CV_VERSION_MINOR)
 #pragma comment(lib, "opencv_core" OPENCV_VERSION ".lib")
 #pragma comment(lib, "opencv_imgproc" OPENCV_VERSION ".lib")
 #pragma comment(lib, "opencv_highgui" OPENCV_VERSION ".lib")
@@ -132,6 +132,8 @@
 			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
+			if (dim_w < 32) dim_w = 32;
+			if (dim_h < 32) dim_h = 32;
 
 			printf("%d x %d \n", dim_w, dim_h);
 			args.w = dim_w;
@@ -425,7 +427,7 @@
 		fprintf(fp, "\n]\n");
 		fclose(fp);
 	}
-	fprintf(stderr, "Total Detection Time: %f Seconds\n", time(0) - start);
+	fprintf(stderr, "Total Detection Time: %f Seconds\n", (double)time(0) - start);
 }
 
 void validate_detector_recall(char *datacfg, char *cfgfile, char *weightfile)
@@ -479,6 +481,7 @@
 		find_replace(labelpath, ".bmp", ".txt", labelpath);
 		find_replace(labelpath, ".JPG", ".txt", labelpath);
 		find_replace(labelpath, ".JPEG", ".txt", labelpath);
+		find_replace(labelpath, ".ppm", ".txt", labelpath);
 
 		int num_labels = 0;
 		box_label *truth = read_boxes(labelpath, &num_labels);
@@ -636,6 +639,7 @@
 			find_replace(labelpath, ".bmp", ".txt", labelpath);
 			find_replace(labelpath, ".JPG", ".txt", labelpath);
 			find_replace(labelpath, ".JPEG", ".txt", labelpath);
+			find_replace(labelpath, ".ppm", ".txt", labelpath);
 			int num_labels = 0;
 			box_label *truth = read_boxes(labelpath, &num_labels);
 			int i, j;
@@ -899,6 +903,7 @@
 		find_replace(labelpath, ".bmp", ".txt", labelpath);
 		find_replace(labelpath, ".JPG", ".txt", labelpath);
 		find_replace(labelpath, ".JPEG", ".txt", labelpath);
+		find_replace(labelpath, ".ppm", ".txt", labelpath);
 		int num_labels = 0;
 		box_label *truth = read_boxes(labelpath, &num_labels);
 		//printf(" new path: %s \n", labelpath);

--
Gitblit v1.10.0