Skip to content

Commit

Permalink
Remove truth only if smaller than 1x1 pix during training
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyAB committed Apr 10, 2018
1 parent 0c95d8d commit 2ce6460
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ void fill_truth_detection(char *path, int num_boxes, float *truth, int classes,
int count = 0;
int i;
box_label *boxes = read_boxes(labelpath, &count);
float lowest_w = 1.F / net_w;
float lowest_h = 1.F / net_h;
if (small_object == 1) {
float lowest_w = 1.F / net_w;
float lowest_h = 1.F / net_h;
for (i = 0; i < count; ++i) {
if (boxes[i].w < lowest_w) boxes[i].w = lowest_w;
if (boxes[i].h < lowest_h) boxes[i].h = lowest_h;
Expand All @@ -329,7 +329,9 @@ void fill_truth_detection(char *path, int num_boxes, float *truth, int classes,
id = boxes[i].id;

// not detect small objects
if ((w < 0.001F || h < 0.001F)) continue;
//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;

truth[i*5+0] = x;
truth[i*5+1] = y;
Expand Down

0 comments on commit 2ce6460

Please sign in to comment.