diff --git a/craft_utils.py b/craft_utils.py index 43c1357..c75d9b0 100755 --- a/craft_utils.py +++ b/craft_utils.py @@ -73,8 +73,9 @@ def getDetBoxes_core(textmap, linkmap, text_threshold, link_threshold, low_text) box = np.roll(box, 4-startidx, 0) box = np.array(box) - det.append(box) - mapper.append(k) + if np.count_nonzero(box) != 0: + det.append(box) + mapper.append(k) return det, labels, mapper