Minor fix

This commit is contained in:
AlexeyAB
2018-06-10 13:58:37 +03:00
parent 17520296c7
commit 22796c5a49
4 changed files with 31 additions and 31 deletions

View File

@ -976,6 +976,7 @@ void calc_anchors(char *datacfg, int num_of_clusters, int width, int height, int
//for (i = 0; i < number_of_boxes; ++i)
// printf("%2.2f,%2.2f, ", points->data.fl[i * 2], points->data.fl[i * 2 + 1]);
printf("\n");
float avg_iou = 0;
for (i = 0; i < number_of_boxes; ++i) {
float box_w = points->data.fl[i * 2];
@ -999,7 +1000,7 @@ void calc_anchors(char *datacfg, int num_of_clusters, int width, int height, int
float box_intersect = min_w*min_h;
float box_union = box_w*box_h + anchor_w*anchor_h - box_intersect;
float iou = box_intersect / box_union;
if (iou > 1 || iou < 0) {
if (iou > 1 || iou < 0 || box_w > width || box_h > height) {
printf(" i = %d, box_w = %d, box_h = %d, anchor_w = %d, anchor_h = %d, iou = %f \n",
i, box_w, box_h, anchor_w, anchor_h, iou);
}