From 57678932921a813531d317c4b079a46f815e130d Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Thu, 19 Apr 2018 22:59:04 +0000
Subject: [PATCH] Fixed typo for calc_anchors

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

diff --git a/src/detector.c b/src/detector.c
index c5afae5..082b748 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -460,6 +460,9 @@
 		find_replace(path, "images", "labels", labelpath);
 		find_replace(labelpath, "JPEGImages", "labels", labelpath);
 		find_replace(labelpath, ".jpg", ".txt", labelpath);
+		find_replace(labelpath, ".png", ".txt", labelpath);
+		find_replace(labelpath, ".bmp", ".txt", labelpath);
+		find_replace(labelpath, ".JPG", ".txt", labelpath);
 		find_replace(labelpath, ".JPEG", ".txt", labelpath);
 
 		int num_labels = 0;
@@ -484,7 +487,7 @@
 				++correct;
 			}
 		}
-		fprintf(stderr, " %s - %s - ", paths[i], labelpath);
+		//fprintf(stderr, " %s - %s - ", paths[i], labelpath);
 		fprintf(stderr, "%5d %5d %5d\tRPs/Img: %.2f\tIOU: %.2f%%\tRecall:%.2f%%\n", i, correct, total, (float)proposals / (i + 1), avg_iou * 100 / total, 100.*correct / total);
 		free(id);
 		free_image(orig);
@@ -614,8 +617,10 @@
 			find_replace(path, "images", "labels", labelpath);
 			find_replace(labelpath, "JPEGImages", "labels", labelpath);
 			find_replace(labelpath, ".jpg", ".txt", labelpath);
-			find_replace(labelpath, ".JPEG", ".txt", labelpath);
 			find_replace(labelpath, ".png", ".txt", labelpath);
+			find_replace(labelpath, ".bmp", ".txt", labelpath);
+			find_replace(labelpath, ".JPG", ".txt", labelpath);
+			find_replace(labelpath, ".JPEG", ".txt", labelpath);
 			int num_labels = 0;
 			box_label *truth = read_boxes(labelpath, &num_labels);
 			int i, j;
@@ -861,8 +866,10 @@
 		find_replace(path, "images", "labels", labelpath);
 		find_replace(labelpath, "JPEGImages", "labels", labelpath);
 		find_replace(labelpath, ".jpg", ".txt", labelpath);
-		find_replace(labelpath, ".JPEG", ".txt", labelpath);
 		find_replace(labelpath, ".png", ".txt", labelpath);
+		find_replace(labelpath, ".bmp", ".txt", labelpath);
+		find_replace(labelpath, ".JPG", ".txt", labelpath);
+		find_replace(labelpath, ".JPEG", ".txt", labelpath);
 		int num_labels = 0;
 		box_label *truth = read_boxes(labelpath, &num_labels);
 		//printf(" new path: %s \n", labelpath);
@@ -1056,8 +1063,8 @@
 
         float *X = sized.data;
         time= what_time_is_it_now();
-        network_predict(net, X);
-		//network_predict_image(&net, im);
+        //network_predict(net, X);
+		network_predict_image(&net, im); letterbox = 1;
         printf("%s: Predicted in %f seconds.\n", input, (what_time_is_it_now()-time));
         //get_region_boxes(l, 1, 1, thresh, probs, boxes, 0, 0);
 		// if (nms) do_nms_sort_v2(boxes, probs, l.w*l.h*l.n, l.classes, nms);
@@ -1100,7 +1107,7 @@
     int frame_skip = find_int_arg(argc, argv, "-s", 0);
 	int num_of_clusters = find_int_arg(argc, argv, "-num_of_clusters", 5);
 	int width = find_int_arg(argc, argv, "-width", 13);
-	int heigh = find_int_arg(argc, argv, "-heigh", 13);
+	int height = find_int_arg(argc, argv, "-height", 13);
     if(argc < 4){
         fprintf(stderr, "usage: %s %s [train/test/valid] [cfg] [weights (optional)]\n", argv[0], argv[1]);
         return;
@@ -1141,7 +1148,7 @@
     else if(0==strcmp(argv[2], "valid")) validate_detector(datacfg, cfg, weights, outfile);
     else if(0==strcmp(argv[2], "recall")) validate_detector_recall(datacfg, cfg, weights);
 	else if(0==strcmp(argv[2], "map")) validate_detector_map(datacfg, cfg, weights, thresh);
-	else if(0==strcmp(argv[2], "calc_anchors")) calc_anchors(datacfg, num_of_clusters, width, heigh, show);
+	else if(0==strcmp(argv[2], "calc_anchors")) calc_anchors(datacfg, num_of_clusters, width, height, show);
     else if(0==strcmp(argv[2], "demo")) {
         list *options = read_data_cfg(datacfg);
         int classes = option_find_int(options, "classes", 20);

--
Gitblit v1.10.0