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
491e2ef3
"examples/vscode:/vscode.git/clone" did not exist on "4eb9ad0d1c7cc86a4c533b0da261e9bf57128166"
Commit
491e2ef3
authored
May 09, 2022
by
andyjpaddle
Browse files
update cpp serving for v3
parent
7ffb995b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
deploy/pdserving/ocr_cpp_client.py
deploy/pdserving/ocr_cpp_client.py
+2
-3
No files found.
deploy/pdserving/ocr_cpp_client.py
View file @
491e2ef3
...
@@ -30,7 +30,7 @@ client.load_client_config(sys.argv[1:])
...
@@ -30,7 +30,7 @@ client.load_client_config(sys.argv[1:])
client
.
connect
([
"127.0.0.1:9293"
])
client
.
connect
([
"127.0.0.1:9293"
])
import
paddle
import
paddle
test_img_dir
=
"
test_
img/"
test_img_dir
=
"
../../doc/
img
s
/"
ocr_reader
=
OCRReader
(
char_dict_path
=
"../../ppocr/utils/ppocr_keys_v1.txt"
)
ocr_reader
=
OCRReader
(
char_dict_path
=
"../../ppocr/utils/ppocr_keys_v1.txt"
)
...
@@ -45,8 +45,7 @@ for img_file in os.listdir(test_img_dir):
...
@@ -45,8 +45,7 @@ for img_file in os.listdir(test_img_dir):
image_data
=
file
.
read
()
image_data
=
file
.
read
()
image
=
cv2_to_base64
(
image_data
)
image
=
cv2_to_base64
(
image_data
)
res_list
=
[]
res_list
=
[]
fetch_map
=
client
.
predict
(
fetch_map
=
client
.
predict
(
feed
=
{
"x"
:
image
},
fetch
=
[],
batch
=
True
)
feed
=
{
"x"
:
image
},
fetch
=
[
"save_infer_model/scale_0.tmp_1"
],
batch
=
True
)
one_batch_res
=
ocr_reader
.
postprocess
(
fetch_map
,
with_score
=
True
)
one_batch_res
=
ocr_reader
.
postprocess
(
fetch_map
,
with_score
=
True
)
for
res
in
one_batch_res
:
for
res
in
one_batch_res
:
res_list
.
append
(
res
[
0
])
res_list
.
append
(
res
[
0
])
...
...
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