From 324e0a33dd7a3bf5f47c88b37de68dfca917ef2d Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Fri, 18 Apr 2014 06:14:13 +0000
Subject: [PATCH] Better alternating between video cards

---
 src/tests.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/tests.c b/src/tests.c
index 2789bed..e91fb63 100644
--- a/src/tests.c
+++ b/src/tests.c
@@ -504,7 +504,7 @@
 	cvResize(src, sized, CV_INTER_LINEAR);
 	image im = ipl_to_image(sized);
 	//normalize_array(im.data, im.h*im.w*im.c);
-	//translate_image(im, -144);
+	translate_image(im, -144);
 	resize_network(net, im.h, im.w, im.c);
 	forward_network(net, im.data);
 	image out = get_network_image(net);
@@ -665,15 +665,13 @@
 {
 	int interval = 4;
 	int i,j;
-	network net = parse_network_cfg("cfg/voc_imagenet_nonorm.cfg");
+	network net = parse_network_cfg("cfg/voc_imagenet.cfg");
 	char image_path[1024];
 	sprintf(image_path, "%s/%s",image_dir, image_file);
 	char out_path[1024];
 	if (flip)sprintf(out_path, "%s%d/%s_r.txt",out_dir, interval, image_file);
 	else sprintf(out_path, "%s%d/%s.txt",out_dir, interval, image_file);
 	printf("%s\n", image_file);
-	FILE *fp = fopen(out_path, "w");
-	if(fp == 0) file_error(out_path);
 
 	IplImage* src = 0;
 	if( (src = cvLoadImage(image_path,-1)) == 0 ) file_error(image_path);
@@ -709,13 +707,15 @@
 			ims[j+interval] = features_output_size(net, src, ex_h, ex_w);
 		}
 	}
+	FILE *fp = fopen(out_path, "w");
+	if(fp == 0) file_error(out_path);
 	for(i = 0; i < max_scale+interval; ++i){
 		image out = ims[i];
 		fprintf(fp, "%d, %d, %d\n",out.c, out.h, out.w);
 		for(j = 0; j < out.c*out.h*out.w; ++j){
 			if(j != 0)fprintf(fp, ",");
 			float o = out.data[j];
-			//if(o < 0) o = 0;
+			if(o < 0) o = 0;
 			fprintf(fp, "%g", o);
 		}
 		fprintf(fp, "\n");

--
Gitblit v1.10.0