From 56b6561ae4f1e238ba1a65701f91b40636037cc2 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Tue, 24 Mar 2015 20:20:56 +0000
Subject: [PATCH] stuff changed probably
---
src/detection.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/detection.c b/src/detection.c
index 522a321..1800ca6 100644
--- a/src/detection.c
+++ b/src/detection.c
@@ -50,7 +50,7 @@
if(weightfile){
load_weights(&net, weightfile);
}
- net.seen = 0;
+ //net.seen = 0;
printf("Learning Rate: %g, Momentum: %g, Decay: %g\n", net.learning_rate, net.momentum, net.decay);
int imgs = 128;
srand(time(0));
@@ -63,7 +63,7 @@
int im_dim = 512;
int jitter = 64;
int classes = 20;
- int background = 0;
+ int background = 1;
pthread_t load_thread = load_data_detection_thread(imgs, paths, plist->size, classes, im_dim, im_dim, 7, 7, jitter, background, &buffer);
clock_t time;
while(1){
@@ -109,8 +109,9 @@
char **paths = (char **)list_to_array(plist);
int im_size = 448;
int classes = 20;
- int background = 0;
- int num_output = 7*7*(4+classes+background);
+ int background = 1;
+ int nuisance = 0;
+ int num_output = 7*7*(4+classes+background+nuisance);
int m = plist->size;
int i = 0;
@@ -134,17 +135,19 @@
matrix pred = network_predict_data(net, val);
int j, k, class;
for(j = 0; j < pred.rows; ++j){
- for(k = 0; k < pred.cols; k += classes+4+background){
+ for(k = 0; k < pred.cols; k += classes+4+background+nuisance){
+ float scale = 1.;
+ if(nuisance) scale = pred.vals[j][k];
for(class = 0; class < classes; ++class){
- int index = (k)/(classes+4+background);
+ int index = (k)/(classes+4+background+nuisance);
int r = index/7;
int c = index%7;
- int ci = k+classes+background;
+ int ci = k+classes+background+nuisance;
float y = (r + pred.vals[j][ci + 0])/7.;
float x = (c + pred.vals[j][ci + 1])/7.;
float h = pred.vals[j][ci + 2];
float w = pred.vals[j][ci + 3];
- printf("%d %d %f %f %f %f %f\n", (i-1)*m/splits + j, class, pred.vals[j][k+class+background], y, x, h, w);
+ printf("%d %d %f %f %f %f %f\n", (i-1)*m/splits + j, class, scale*pred.vals[j][k+class+background+nuisance], y, x, h, w);
}
}
}
--
Gitblit v1.10.0