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
d50addb8
Commit
d50addb8
authored
Apr 12, 2022
by
andyjpaddle
Browse files
fix rare trt shape error
parent
a8318353
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
test_tipc/configs/rec_r34_vd_tps_bilstm_att_v2.0/train_infer_python.txt
...igs/rec_r34_vd_tps_bilstm_att_v2.0/train_infer_python.txt
+1
-1
tools/infer/predict_rec.py
tools/infer/predict_rec.py
+4
-0
tools/infer/utility.py
tools/infer/utility.py
+4
-0
No files found.
test_tipc/configs/rec_r34_vd_tps_bilstm_att_v2.0/train_infer_python.txt
View file @
d50addb8
...
@@ -37,7 +37,7 @@ export2:null
...
@@ -37,7 +37,7 @@ export2:null
train_model:./inference/rec_r34_vd_tps_bilstm_att_v2.0_train/best_accuracy
train_model:./inference/rec_r34_vd_tps_bilstm_att_v2.0_train/best_accuracy
infer_export:tools/export_model.py -c test_tipc/configs/rec_r34_vd_tps_bilstm_att_v2.0/rec_r34_vd_tps_bilstm_att.yml -o
infer_export:tools/export_model.py -c test_tipc/configs/rec_r34_vd_tps_bilstm_att_v2.0/rec_r34_vd_tps_bilstm_att.yml -o
infer_quant:False
infer_quant:False
inference:tools/infer/predict_rec.py --rec_char_dict_path=./ppocr/utils/ic15_dict.txt --rec_image_shape="3,32,100" --rec_algorithm="RARE"
inference:tools/infer/predict_rec.py --rec_char_dict_path=./ppocr/utils/ic15_dict.txt --rec_image_shape="3,32,100" --rec_algorithm="RARE"
--min_subgraph_size=5
--use_gpu:True|False
--use_gpu:True|False
--enable_mkldnn:True|False
--enable_mkldnn:True|False
--cpu_threads:1|6
--cpu_threads:1|6
...
...
tools/infer/predict_rec.py
View file @
d50addb8
...
@@ -119,6 +119,10 @@ class TextRecognizer(object):
...
@@ -119,6 +119,10 @@ class TextRecognizer(object):
resized_w
=
imgW
resized_w
=
imgW
else
:
else
:
resized_w
=
int
(
math
.
ceil
(
imgH
*
ratio
))
resized_w
=
int
(
math
.
ceil
(
imgH
*
ratio
))
if
self
.
rec_algorithm
==
'RARE'
:
if
resized_w
>
self
.
rec_image_shape
[
2
]:
resized_w
=
self
.
rec_image_shape
[
2
]
imgW
=
self
.
rec_image_shape
[
2
]
resized_image
=
cv2
.
resize
(
img
,
(
resized_w
,
imgH
))
resized_image
=
cv2
.
resize
(
img
,
(
resized_w
,
imgH
))
resized_image
=
resized_image
.
astype
(
'float32'
)
resized_image
=
resized_image
.
astype
(
'float32'
)
resized_image
=
resized_image
.
transpose
((
2
,
0
,
1
))
/
255
resized_image
=
resized_image
.
transpose
((
2
,
0
,
1
))
/
255
...
...
tools/infer/utility.py
View file @
d50addb8
...
@@ -323,6 +323,10 @@ def get_output_tensors(args, mode, predictor):
...
@@ -323,6 +323,10 @@ def get_output_tensors(args, mode, predictor):
output_name
=
'softmax_0.tmp_0'
output_name
=
'softmax_0.tmp_0'
if
output_name
in
output_names
:
if
output_name
in
output_names
:
return
[
predictor
.
get_output_handle
(
output_name
)]
return
[
predictor
.
get_output_handle
(
output_name
)]
else
:
for
output_name
in
output_names
:
output_tensor
=
predictor
.
get_output_handle
(
output_name
)
output_tensors
.
append
(
output_tensor
)
else
:
else
:
for
output_name
in
output_names
:
for
output_name
in
output_names
:
output_tensor
=
predictor
.
get_output_handle
(
output_name
)
output_tensor
=
predictor
.
get_output_handle
(
output_name
)
...
...
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