From 4af116e996fe04b739bf6eee211be36660c212f4 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Sat, 21 Mar 2015 19:25:14 +0000
Subject: [PATCH] gonna change im2col
---
src/data.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/data.c b/src/data.c
index 342edfa..8dd7d9a 100644
--- a/src/data.c
+++ b/src/data.c
@@ -112,7 +112,12 @@
randomize_boxes(boxes, count);
float x, y, h, w;
int id;
- int i, j;
+ int i;
+ if(background){
+ for(i = 0; i < num_height*num_width*(4+classes+background); i += 4+classes+background){
+ truth[i] = 1;
+ }
+ }
for(i = 0; i < count; ++i){
x = boxes[i].x;
y = boxes[i].y;
@@ -137,21 +142,15 @@
int index = (i+j*num_width)*(4+classes+background);
if(truth[index+classes+background]) continue;
+ if(background) truth[index++] = 0;
truth[index+id] = 1;
- index += classes+background;
+ index += classes;
truth[index++] = dh;
truth[index++] = dw;
truth[index++] = h*(height+jitter)/height;
truth[index++] = w*(width+jitter)/width;
}
free(boxes);
- if(background){
- for(i = 0; i < num_height*num_width*(4+classes+background); i += 4+classes+background){
- int object = 0;
- for(j = i; j < i+classes; ++j) if (truth[j]) object = 1;
- truth[i+classes] = !object;
- }
- }
}
#define NUMCHARS 37
@@ -202,6 +201,7 @@
data d;
d.shallow = 0;
d.X = load_image_paths(paths, n, h, w);
+ d.X.cols = 17100;
d.y = d.X;
if(m) free(paths);
return d;
--
Gitblit v1.10.0