From 6d44529cf93211c319813c90e0c1adb34426abe5 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Wed, 13 Jun 2018 10:50:02 +0000
Subject: [PATCH] Minor fix

---
 src/detector.c |    3 +++
 README.md      |    3 +--
 src/utils.c    |   12 ++++++------
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index 27c622d..5f81cd3 100644
--- a/README.md
+++ b/README.md
@@ -100,7 +100,6 @@
 * Remeber to put data/9k.tree and data/coco9k.map under the same folder of your app if you use the cpp api to build an app
 * To process a list of images `data/train.txt` and save results of detection to `result.txt` use:                             
     `darknet.exe detector test data/voc.data yolo-voc.cfg yolo-voc.weights -dont_show -ext_output < data/train.txt > result.txt`
-    You can comment this line so that each image does not require pressing the button ESC: https://github.com/AlexeyAB/darknet/blob/6ccb41808caf753feea58ca9df79d6367dedc434/src/detector.c#L509
 
 ##### For using network video-camera mjpeg-stream with any Android smartphone:
 
@@ -428,7 +427,7 @@
   * for training for small objects - set `layers = -1, 11` instead of https://github.com/AlexeyAB/darknet/blob/6390a5a2ab61a0bdf6f1a9a6b4a739c16b36e0d7/cfg/yolov3.cfg#L720
       and set `stride=4` instead of https://github.com/AlexeyAB/darknet/blob/6390a5a2ab61a0bdf6f1a9a6b4a739c16b36e0d7/cfg/yolov3.cfg#L717
   
-  * General rule - you should keep relative size of objects in the Training and Testing datasets roughly the same: 
+  * General rule - your training dataset should include such a set of relative sizes of objects that you want to detect - differing by no more than 2 times: 
 
     * `train_network_width * train_obj_width / train_image_width ~= detection_network_width * detection_obj_width / detection_image_width`
     * `train_network_height * train_obj_height / train_image_height ~= detection_network_height * detection_obj_height / detection_image_height`
diff --git a/src/detector.c b/src/detector.c
index 2a4c4a2..afb91b2 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -65,6 +65,9 @@
 		printf("\n Error: You set incorrect value batch=1 for Training! You should set batch=64 subdivision=64 \n");
 		getchar();
 	}
+	else if ((net.batch * net.subdivisions) < 64) {
+			printf("\n Warning: You set batch= lower than 64! It is recommended to set batch=64 subdivision=64 \n");
+	}
 
     int imgs = net.batch * net.subdivisions * ngpus;
     printf("Learning Rate: %g, Momentum: %g, Decay: %g\n", net.learning_rate, net.momentum, net.decay);
diff --git a/src/utils.c b/src/utils.c
index f1cc21a..4b8ca7d 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -206,12 +206,12 @@
 }
 
 void replace_image_to_label(char *input_path, char *output_path) {
-	//find_replace(input_path, "images", "labels", output_path);	// COCO
-	find_replace(input_path, "images/train2014/", "labels/train2014/", output_path);	// COCO
-	find_replace(output_path, "images/val2014/", "labels/val2014/", output_path);		// COCO
-	//find_replace(output_path, "JPEGImages", "labels", output_path);	// PascalVOC
-	find_replace(output_path, "VOC2007/JPEGImages", "VOC2007/labels", output_path);		// PascalVOC
-	find_replace(output_path, "VOC2012/JPEGImages", "VOC2012/labels", output_path);		// PascalVOC
+	//find_replace(input_path, "/images/", "/labels/", output_path);	// COCO
+	find_replace(input_path, "/images/train2014/", "/labels/train2014/", output_path);	// COCO
+	find_replace(output_path, "/images/val2014/", "/labels/val2014/", output_path);		// COCO
+	//find_replace(output_path, "/JPEGImages/", "/labels/", output_path);	// PascalVOC
+	find_replace(output_path, "/VOC2007/JPEGImages/", "/VOC2007/labels/", output_path);		// PascalVOC
+	find_replace(output_path, "/VOC2012/JPEGImages/", "/VOC2012/labels/", output_path);		// PascalVOC
 
 	//find_replace(output_path, "/raw/", "/labels/", output_path);
 

--
Gitblit v1.10.0