mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2025-06-03 21:53:39 +08:00
fix infer shape
This commit is contained in:
parent
68e52250f3
commit
7488bc1db5
@ -89,6 +89,7 @@ class TextRecognizer(object):
|
|||||||
imgC, imgH, imgW = self.rec_image_shape
|
imgC, imgH, imgW = self.rec_image_shape
|
||||||
assert imgC == img.shape[2]
|
assert imgC == img.shape[2]
|
||||||
if self.character_type == "ch":
|
if self.character_type == "ch":
|
||||||
|
max_wh_ratio = max(max_wh_ratio, imgW / imgH)
|
||||||
imgW = int((32 * max_wh_ratio))
|
imgW = int((32 * max_wh_ratio))
|
||||||
h, w = img.shape[:2]
|
h, w = img.shape[:2]
|
||||||
ratio = w / float(h)
|
ratio = w / float(h)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user