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
1bf24676
Commit
1bf24676
authored
Aug 23, 2021
by
LDOUBLEV
Browse files
fix rec trt
parent
5f7d4b9f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
tools/infer/predict_rec.py
tools/infer/predict_rec.py
+1
-1
tools/infer/utility.py
tools/infer/utility.py
+4
-4
No files found.
tools/infer/predict_rec.py
View file @
1bf24676
...
...
@@ -277,7 +277,7 @@ def main(args):
if
args
.
warmup
:
img
=
np
.
random
.
uniform
(
0
,
255
,
[
32
,
320
,
3
]).
astype
(
np
.
uint8
)
for
i
in
range
(
2
):
res
=
text_recognizer
([
img
])
res
=
text_recognizer
([
img
]
*
int
(
args
.
rec_batch_num
)
)
for
image_file
in
image_file_list
:
img
,
flag
=
check_and_read_gif
(
image_file
)
...
...
tools/infer/utility.py
View file @
1bf24676
...
...
@@ -231,13 +231,13 @@ def create_predictor(args, mode, logger):
max_input_shape
.
update
(
max_pact_shape
)
opt_input_shape
.
update
(
opt_pact_shape
)
elif
mode
==
"rec"
:
min_input_shape
=
{
"x"
:
[
1
,
3
,
32
,
10
]}
min_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
32
,
10
]}
max_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
32
,
2000
]}
opt_input_shape
=
{
"x"
:
[
512
,
3
,
32
,
320
]}
opt_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
32
,
320
]}
elif
mode
==
"cls"
:
min_input_shape
=
{
"x"
:
[
1
,
3
,
48
,
10
]}
min_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
48
,
10
]}
max_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
48
,
2000
]}
opt_input_shape
=
{
"x"
:
[
512
,
3
,
48
,
320
]}
opt_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
48
,
320
]}
else
:
min_input_shape
=
{
"x"
:
[
1
,
3
,
10
,
10
]}
max_input_shape
=
{
"x"
:
[
1
,
3
,
1000
,
1000
]}
...
...
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