From 47528e37cf29e0f9da6885213e5aee044bed84ef Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Wed, 15 Apr 2015 08:04:38 +0000
Subject: [PATCH] crop layer scaling and trans on cpu

---
 src/detection.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/detection.c b/src/detection.c
index 1cf9ef0..024c0e9 100644
--- a/src/detection.c
+++ b/src/detection.c
@@ -57,6 +57,7 @@
 void train_detection(char *cfgfile, char *weightfile)
 {
     srand(time(0));
+    data_seed = time(0);
     int imgnet = 0;
     char *base = basecfg(cfgfile);
     printf("%s\n", base);
@@ -93,9 +94,13 @@
         load_thread = load_data_detection_thread(imgs, paths, plist->size, classes, net.w, net.h, side, side, background, &buffer);
 
 /*
-           image im = float_to_image(im_dim, im_dim, 3, train.X.vals[114]);
-           draw_detection(im, train.y.vals[114], 7);
-*/
+           image im = float_to_image(net.w, net.h, 3, train.X.vals[114]);
+           image copy = copy_image(im);
+           translate_image(copy, 1);
+           scale_image(copy, .5);
+           draw_detection(copy, train.y.vals[114], 7);
+           free_image(copy);
+           */
 
         printf("Loaded: %lf seconds\n", sec(clock()-time));
         time=clock();
@@ -198,8 +203,6 @@
         fgets(filename, 256, stdin);
         strtok(filename, "\n");
         image im = load_image_color(filename, im_size, im_size);
-        translate_image(im, -128);
-        scale_image(im, 1/128.);
         printf("%d %d %d\n", im.h, im.w, im.c);
         float *X = im.data;
         time=clock();

--
Gitblit v1.10.0