label_ops.py.rej 970 B

1234567891011121314151617181920212223242526
  1. diff a/ppocr/data/imaug/label_ops.py b/ppocr/data/imaug/label_ops.py (rejected hunks)
  2. @@ -58,17 +72,24 @@ class DetLabelEncode(object):
  3. txts.append(txt)
  4. if txt in ['*', '###']:
  5. txt_tags.append(True)
  6. + if self.num_classes > 1:
  7. + classes.append(-2)
  8. else:
  9. txt_tags.append(False)
  10. + if self.num_classes > 1:
  11. + classes.append(int(self.label_list.index(txt)))
  12. if len(boxes) == 0:
  13. return None
  14. boxes = self.expand_points_num(boxes)
  15. boxes = np.array(boxes, dtype=np.float32)
  16. txt_tags = np.array(txt_tags, dtype=np.bool)
  17. + classes = classes
  18. data['polys'] = boxes
  19. data['texts'] = txts
  20. data['ignore_tags'] = txt_tags
  21. + if self.num_classes > 1:
  22. + data['classes'] = classes
  23. return data
  24. def order_points_clockwise(self, pts):