From c40cdeb4021fc1a638969563972f13c9f5e90d74 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Fri, 09 Oct 2015 19:50:43 +0000
Subject: [PATCH] lots of comparator stuff

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

diff --git a/src/imagenet.c b/src/imagenet.c
index c826a0f..1701a2a 100644
--- a/src/imagenet.c
+++ b/src/imagenet.c
@@ -133,7 +133,7 @@
         printf("Loaded: %d images in %lf seconds\n", val.X.rows, sec(clock()-time));
 
         time=clock();
-        float *acc = network_accuracies(net, val);
+        float *acc = network_accuracies(net, val, 5);
         avg_acc += acc[0];
         avg_top5 += acc[1];
         printf("%d: top1: %f, top5: %f, %lf seconds, %d images\n", i, avg_acc/i, avg_top5/i, sec(clock()-time), val.X.rows);
@@ -152,15 +152,17 @@
     int i = 0;
     char **names = get_labels("data/shortnames.txt");
     clock_t time;
-    char input[256];
     int indexes[10];
+    char buff[256];
+    char *input = buff;
     while(1){
         if(filename){
             strncpy(input, filename, 256);
         }else{
             printf("Enter Image Path: ");
             fflush(stdout);
-            fgets(input, 256, stdin);
+            input = fgets(input, 256, stdin);
+            if(!input) return;
             strtok(input, "\n");
         }
         image im = load_image_color(input, 256, 256);

--
Gitblit v1.10.0