Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
469e76cc
Commit
469e76cc
authored
Sep 14, 2021
by
Topdu
Browse files
comment review
parent
6e8c3ee1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
15 deletions
+1
-15
tools/infer/predict_rec.py
tools/infer/predict_rec.py
+1
-15
No files found.
tools/infer/predict_rec.py
View file @
469e76cc
...
...
@@ -94,22 +94,8 @@ class TextRecognizer(object):
def
resize_norm_img
(
self
,
img
,
max_wh_ratio
):
imgC
,
imgH
,
imgW
=
self
.
rec_image_shape
if
imgC
==
1
:
if
self
.
rec_algorithm
==
'NRTR'
:
img
=
cv2
.
cvtColor
(
img
,
cv2
.
COLOR_BGR2GRAY
)
# h = img.shape[0]
# w = img.shape[1]
# ratio = w / float(h)
# if math.ceil(imgH * ratio) > imgW:
# resized_w = imgW
# else:
# resized_w = int(math.ceil(imgH * ratio))
# resized_image = cv2.resize(img, (resized_w, imgH))
# #norm_img = np.expand_dims(resized_image, -1)
# #norm_img = norm_img.transpose((2, 0, 1))
# resized_image = resized_image.astype(np.float32) / 128. - 1.
# padding_im = np.zeros((imgC, imgH, imgW), dtype=np.float32)
# padding_im[0, :, 0:resized_w] = resized_image
# return padding_im
image_pil
=
Image
.
fromarray
(
np
.
uint8
(
img
))
img
=
image_pil
.
resize
([
100
,
32
],
Image
.
ANTIALIAS
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment