Spaces:
Sleeping
Sleeping
Commit
·
38f7bb7
1
Parent(s):
3b86270
increase ocr iteration
Browse files
ocr.py
CHANGED
@@ -75,8 +75,9 @@ class Recognizer:
|
|
75 |
inn_img = self.preprocess(inn_img, height=self.inn_h, width=self.inn_w)
|
76 |
inn_img = inn_img[None, :, :, :]
|
77 |
|
78 |
-
|
79 |
-
|
|
|
80 |
result, nbest = self.codec.decode(preds)
|
81 |
|
82 |
return result, nbest
|
|
|
75 |
inn_img = self.preprocess(inn_img, height=self.inn_h, width=self.inn_w)
|
76 |
inn_img = inn_img[None, :, :, :]
|
77 |
|
78 |
+
for _ in range(2):
|
79 |
+
self.infer_request.infer(inputs={self.input_tensor_name: inn_img})
|
80 |
+
preds = self.infer_request.get_tensor(self.output_tensor_name).data[:]
|
81 |
result, nbest = self.codec.decode(preds)
|
82 |
|
83 |
return result, nbest
|