From 1b5e6d8855064e5d990bd73f1f3a0aa00cbdfb4c Mon Sep 17 00:00:00 2001 From: Joseph Redmon Date: Sat, 1 Mar 2014 14:41:30 -0800 Subject: [PATCH] Flipping features now a flag --- src/tests.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tests.c b/src/tests.c index 557f0fbf..1c7b01d9 100644 --- a/src/tests.c +++ b/src/tests.c @@ -528,22 +528,25 @@ void features_VOC(int part, int total) 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