From 04c0c4fdf84bb7b9e89604e8b9a6079016d5968c Mon Sep 17 00:00:00 2001
From: Alexey <AlexeyAB@users.noreply.github.com>
Date: Wed, 04 Jul 2018 16:06:41 +0000
Subject: [PATCH] Merge pull request #1132 from tinohager/master
---
src/yolo_layer.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/yolo_layer.c b/src/yolo_layer.c
index 87dedae..f79bc41 100644
--- a/src/yolo_layer.c
+++ b/src/yolo_layer.c
@@ -201,7 +201,11 @@
for(t = 0; t < l.max_boxes; ++t){
box truth = float_to_box_stride(state.truth + t*(4 + 1) + b*l.truths, 1);
int class_id = state.truth[t*(4 + 1) + b*l.truths + 4];
- if (class_id >= l.classes) continue; // if label contains class_id more than number of classes in the cfg-file
+ if (class_id >= l.classes) {
+ printf(" Warning: in txt-labels class_id=%d >= classes=%d in cfg-file. In txt-labels class_id should be [from 0 to %d] \n", class_id, l.classes, l.classes - 1);
+ getchar();
+ continue; // if label contains class_id more than number of classes in the cfg-file
+ }
if(!truth.x) break;
float iou = box_iou(pred, truth);
if (iou > best_iou) {
--
Gitblit v1.10.0