From 1b5e6d8855064e5d990bd73f1f3a0aa00cbdfb4c Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Sat, 01 Mar 2014 22:41:30 +0000
Subject: [PATCH] Flipping features now a flag

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

diff --git a/src/tests.c b/src/tests.c
index 557f0fb..1c7b01d 100644
--- a/src/tests.c
+++ b/src/tests.c
@@ -528,22 +528,25 @@
 
 void features_VOC_image(char *image_file, char *image_dir, char *out_dir)
 {
+	int flip = 1;
+    int interval = 4;
     int i,j;
     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];
-    sprintf(out_path, "%s%s.txt",out_dir, image_file);
+    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);
+if(flip)cvFlip(src, 0, 1);
     int w = src->width;
     int h = src->height;
     int sbin = 8;
-    int interval = 10;
     double scale = pow(2., 1./interval);
     int m = (w<h)?w:h;
     int max_scale = 1+floor((double)log((double)m/(5.*sbin))/log(scale));

--
Gitblit v1.10.0