From c123f320fcc2212f1d3b59a4d3d2ae6be71cf1e6 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Sun, 04 Mar 2018 20:41:23 +0000
Subject: [PATCH] Show avg-loss chart during Training, if compiled with OpenCV. Use -dont_show to disable.

---
 src/data.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/data.c b/src/data.c
index 71781aa..ea6313a 100644
--- a/src/data.c
+++ b/src/data.c
@@ -304,9 +304,10 @@
     find_replace(labelpath, ".JPG", ".txt", labelpath);
     find_replace(labelpath, ".JPEG", ".txt", labelpath);
     int count = 0;
+	int i;
     box_label *boxes = read_boxes(labelpath, &count);
 	if (small_object == 1) {
-		for (int i = 0; i < count; ++i) {
+		for (i = 0; i < count; ++i) {
 			if (boxes[i].w < 0.01) boxes[i].w = 0.01;
 			if (boxes[i].h < 0.01) boxes[i].h = 0.01;
 		}
@@ -316,7 +317,6 @@
     if(count > num_boxes) count = num_boxes;
     float x,y,w,h;
     int id;
-    int i;
 
     for (i = 0; i < count; ++i) {
         x =  boxes[i].x;
@@ -967,8 +967,8 @@
     for(i = 0; i < 10000; ++i){
         unsigned char bytes[3073];
         fread(bytes, 1, 3073, fp);
-        int class = bytes[0];
-        y.vals[i][class] = 1;
+        int class_id = bytes[0];
+        y.vals[i][class_id] = 1;
         for(j = 0; j < X.cols; ++j){
             X.vals[i][j] = (double)bytes[j+1];
         }
@@ -1031,8 +1031,8 @@
         for(i = 0; i < 10000; ++i){
             unsigned char bytes[3073];
             fread(bytes, 1, 3073, fp);
-            int class = bytes[0];
-            y.vals[i+b*10000][class] = 1;
+            int class_id = bytes[0];
+            y.vals[i+b*10000][class_id] = 1;
             for(j = 0; j < X.cols; ++j){
                 X.vals[i+b*10000][j] = (double)bytes[j+1];
             }

--
Gitblit v1.10.0