From 73f7aacf35ec9b1d0f9de9ddf38af0889f213e99 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Tue, 20 Sep 2016 18:34:49 +0000
Subject: [PATCH] better multigpu

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

diff --git a/src/detector.c b/src/detector.c
index becdd6c..9498750 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -17,7 +17,6 @@
     char *train_images = "/data/voc/train.txt";
     char *backup_directory = "/home/pjreddie/backup/";
     srand(time(0));
-    data_seed = time(0);
     char *base = basecfg(cfgfile);
     printf("%s\n", base);
     float avg_loss = -1;
@@ -117,8 +116,18 @@
             int box_index = index * (classes + 5);
             boxes[index].x = (predictions[box_index + 0] + col + .5) / side * w;
             boxes[index].y = (predictions[box_index + 1] + row + .5) / side * h;
+            if(0){
+                boxes[index].x = (logistic_activate(predictions[box_index + 0]) + col) / side * w;
+                boxes[index].y = (logistic_activate(predictions[box_index + 1]) + row) / side * h;
+            }
             boxes[index].w = pow(logistic_activate(predictions[box_index + 2]), (square?2:1)) * w;
             boxes[index].h = pow(logistic_activate(predictions[box_index + 3]), (square?2:1)) * h;
+            if(1){
+                boxes[index].x = ((col + .5)/side + predictions[box_index + 0] * .5) * w;
+                boxes[index].y = ((row + .5)/side + predictions[box_index + 1] * .5) * h;
+                boxes[index].w = (exp(predictions[box_index + 2]) * .5) * w;
+                boxes[index].h = (exp(predictions[box_index + 3]) * .5) * h;
+            }
             for(j = 0; j < classes; ++j){
                 int class_index = index * (classes + 5) + 5;
                 float prob = scale*predictions[class_index+j];
@@ -237,6 +246,9 @@
             free_image(val_resized[t]);
         }
     }
+    for(j = 0; j < classes; ++j){
+        fclose(fps[j]);
+    }
     fprintf(stderr, "Total Detection Time: %f Seconds\n", (double)(time(0) - start));
 }
 

--
Gitblit v1.10.0