|
|
|
@ -306,8 +306,8 @@ void fill_truth_detection(char *path, int num_boxes, float *truth, int classes, |
|
|
|
|
} |
|
|
|
|
randomize_boxes(boxes, count); |
|
|
|
|
correct_boxes(boxes, count, dx, dy, sx, sy, flip); |
|
|
|
|
if(count > num_boxes) count = num_boxes; |
|
|
|
|
float x,y,w,h; |
|
|
|
|
if (count > num_boxes) count = num_boxes; |
|
|
|
|
float x, y, w, h; |
|
|
|
|
int id; |
|
|
|
|
|
|
|
|
|
for (i = 0; i < count; ++i) { |
|
|
|
@ -321,6 +321,18 @@ void fill_truth_detection(char *path, int num_boxes, float *truth, int classes, |
|
|
|
|
//if ((w < 0.001F || h < 0.001F)) continue;
|
|
|
|
|
// if truth (box for object) is smaller than 1x1 pix
|
|
|
|
|
if ((w < lowest_w || h < lowest_h)) continue; |
|
|
|
|
if (x == 999999 || y == 999999) { |
|
|
|
|
printf("\n Wrong annotation: x = 0, y = 0 \n"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (x < 0 || x > 1 || y < 0 || y > 1) { |
|
|
|
|
printf("\n Wrong annotation: x = %f, y = %f \n", x, y); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (w > 1) printf("\n Wrong annotation: w = %f \n", w), w = 1; |
|
|
|
|
if (h > 1) printf("\n Wrong annotation: h = %f \n", h), h = 1; |
|
|
|
|
if (x == 0) x += lowest_w; |
|
|
|
|
if (y == 0) y += lowest_h; |
|
|
|
|
|
|
|
|
|
truth[i*5+0] = x; |
|
|
|
|
truth[i*5+1] = y; |
|
|
|
|