diff a/ppocr/data/imaug/label_ops.py b/ppocr/data/imaug/label_ops.py (rejected hunks) @@ -58,17 +72,24 @@ class DetLabelEncode(object): txts.append(txt) if txt in ['*', '###']: txt_tags.append(True) + if self.num_classes > 1: + classes.append(-2) else: txt_tags.append(False) + if self.num_classes > 1: + classes.append(int(self.label_list.index(txt))) if len(boxes) == 0: return None boxes = self.expand_points_num(boxes) boxes = np.array(boxes, dtype=np.float32) txt_tags = np.array(txt_tags, dtype=np.bool) + classes = classes data['polys'] = boxes data['texts'] = txts data['ignore_tags'] = txt_tags + if self.num_classes > 1: + data['classes'] = classes return data def order_points_clockwise(self, pts):