Update onnx_text_recognition.py
Browse files- onnx_text_recognition.py +2 -1
onnx_text_recognition.py
CHANGED
@@ -12,7 +12,7 @@ class TextRecognition:
|
|
12 |
model_path,
|
13 |
device = 'cpu',
|
14 |
half_precision = False,
|
15 |
-
line_threshold =
|
16 |
self.device = device
|
17 |
self.half_precision = half_precision
|
18 |
self.line_threshold = line_threshold
|
@@ -94,6 +94,7 @@ class TextRecognition:
|
|
94 |
end = int(min(start + self.line_threshold, len(cropped_lines)))
|
95 |
sc, gt = self.predict_text(cropped_lines[start:end])
|
96 |
scores += sc
|
|
|
97 |
generated_text += gt
|
98 |
return scores, generated_text
|
99 |
|
|
|
12 |
model_path,
|
13 |
device = 'cpu',
|
14 |
half_precision = False,
|
15 |
+
line_threshold = 10):
|
16 |
self.device = device
|
17 |
self.half_precision = half_precision
|
18 |
self.line_threshold = line_threshold
|
|
|
94 |
end = int(min(start + self.line_threshold, len(cropped_lines)))
|
95 |
sc, gt = self.predict_text(cropped_lines[start:end])
|
96 |
scores += sc
|
97 |
+
print(gt)
|
98 |
generated_text += gt
|
99 |
return scores, generated_text
|
100 |
|