From ff7e03325a2f36bf4eb13e1f538b78e1549305cc Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Wed, 20 May 2015 17:06:42 +0000
Subject: [PATCH] detection exp
---
src/detection.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/detection.c b/src/detection.c
index 160fa60..c012848 100644
--- a/src/detection.c
+++ b/src/detection.c
@@ -47,6 +47,8 @@
int top = (y-h/2)*im.h;
int bot = (y+h/2)*im.h;
draw_box(im, left, top, right, bot, red, green, blue);
+ draw_box(im, left+1, top+1, right+1, bot+1, red, green, blue);
+ draw_box(im, left-1, top-1, right-1, bot-1, red, green, blue);
}
}
}
@@ -116,7 +118,11 @@
float loss = train_network(net, train);
//TODO
+ #ifdef GPU
float *out = get_network_output_gpu(net);
+ #else
+ float *out = get_network_output(net);
+ #endif
image im = float_to_image(net.w, net.h, 3, train.X.vals[127]);
image copy = copy_image(im);
draw_localization(copy, &(out[63*80]));
@@ -213,7 +219,7 @@
avg_loss = avg_loss*.9 + loss*.1;
printf("%d: %f, %f avg, %lf seconds, %d images\n", i, loss, avg_loss, sec(clock()-time), i*imgs);
if(i == 100){
- net.learning_rate *= 10;
+ //net.learning_rate *= 10;
}
if(i%100==0){
char buff[256];
@@ -309,8 +315,8 @@
float y = (pred.vals[j][ci + 1] + row)/num_boxes;
float w = pred.vals[j][ci + 2]; //* distance_from_edge(row, num_boxes);
float h = pred.vals[j][ci + 3]; //* distance_from_edge(col, num_boxes);
- w = pow(w, 1);
- h = pow(h, 1);
+ w = pow(w, 2);
+ h = pow(h, 2);
float prob = scale*pred.vals[j][k+class+background+nuisance];
if(prob < threshold) continue;
printf("%d %d %f %f %f %f %f\n", offset + j, class, prob, x, y, w, h);
--
Gitblit v1.10.0