@@ -1471,7 +1471,7 @@ def showBoundingBoxFromPPlabel(self, filePath):
1471
1471
# box['ratio'] of the shapes saved in lockedShapes contains the ratio of the
1472
1472
# four corner coordinates of the shapes to the height and width of the image
1473
1473
for box in self .canvas .lockedShapes :
1474
- key_cls = None if not self .kie_mode else box ['key_cls' ]
1474
+ key_cls = ' None' if not self .kie_mode else box ['key_cls' ]
1475
1475
if self .canvas .isInTheSameImage :
1476
1476
shapes .append ((box ['transcription' ], [[s [0 ] * width , s [1 ] * height ] for s in box ['ratio' ]],
1477
1477
DEFAULT_LOCK_COLOR , key_cls , box ['difficult' ]))
@@ -1480,7 +1480,7 @@ def showBoundingBoxFromPPlabel(self, filePath):
1480
1480
DEFAULT_LOCK_COLOR , key_cls , box ['difficult' ]))
1481
1481
if imgidx in self .PPlabel .keys ():
1482
1482
for box in self .PPlabel [imgidx ]:
1483
- key_cls = None if not self .kie_mode else box .get ('key_cls' , 'None' )
1483
+ key_cls = ' None' if not self .kie_mode else box .get ('key_cls' , 'None' )
1484
1484
shapes .append ((box ['transcription' ], box ['points' ], None , key_cls , box .get ('difficult' , False )))
1485
1485
1486
1486
self .loadLabels (shapes )
@@ -2266,7 +2266,7 @@ def cellreRecognition(self):
2266
2266
rec_res = self .ocr .ocr (patch , det = False , rec = True , cls = False )
2267
2267
text = rec_res [0 ][0 ]
2268
2268
if text != '' :
2269
- texts += text + (' ' if text [0 ].isalpha () else '' ) # add space between english word
2269
+ texts += text + ('' if text [0 ].isalpha () else ' ' ) # add space between english word
2270
2270
probs += rec_res [0 ][1 ]
2271
2271
probs = probs / len (bboxes )
2272
2272
result = [(texts .strip (), probs )]
0 commit comments