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
576cbfa7
Commit
576cbfa7
authored
May 14, 2020
by
tink2123
Browse files
update readme
parent
4e1b206a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
README.md
README.md
+2
-2
ppocr/postprocess/db_postprocess.py
ppocr/postprocess/db_postprocess.py
+5
-3
tools/infer/predict_system.py
tools/infer/predict_system.py
+2
-1
No files found.
README.md
View file @
576cbfa7
...
@@ -37,10 +37,10 @@ tar -xf inference.tar
...
@@ -37,10 +37,10 @@ tar -xf inference.tar
export PYTHONPATH=.
export PYTHONPATH=.
# 预测image_dir指定的单张图像
# 预测image_dir指定的单张图像
python tools/infer/predict_system.py --image_dir="
/D
emo.jpg" --det_model_dir="./inference/det/" --rec_model_dir="./inference/rec/"
python
3
tools/infer/predict_system.py --image_dir="
./d
emo.jpg" --det_model_dir="./inference/det/" --rec_model_dir="./inference/rec/"
# 预测image_dir指定的图像集合
# 预测image_dir指定的图像集合
python tools/infer/predict_system.py --image_dir="
/test
_imgs/" --det_model_dir="./inference/det/" --rec_model_dir="./inference/rec/"
python
3
tools/infer/predict_system.py --image_dir="
./infer
_imgs/" --det_model_dir="./inference/det/" --rec_model_dir="./inference/rec/"
```
```
更多的文本检测、识别串联推理使用方式请参考文档教程中
[
基于推理引擎预测
](
./doc/inference.md
)
。
更多的文本检测、识别串联推理使用方式请参考文档教程中
[
基于推理引擎预测
](
./doc/inference.md
)
。
...
...
ppocr/postprocess/db_postprocess.py
View file @
576cbfa7
...
@@ -46,9 +46,11 @@ class DBPostProcess(object):
...
@@ -46,9 +46,11 @@ class DBPostProcess(object):
bitmap
=
_bitmap
bitmap
=
_bitmap
height
,
width
=
bitmap
.
shape
height
,
width
=
bitmap
.
shape
# img, contours, _ = cv2.findContours((bitmap * 255).astype(np.uint8), cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
outs
=
cv2
.
findContours
((
bitmap
*
255
).
astype
(
np
.
uint8
),
cv2
.
RETR_LIST
,
cv2
.
CHAIN_APPROX_SIMPLE
)
contours
,
_
=
cv2
.
findContours
((
bitmap
*
255
).
astype
(
np
.
uint8
),
if
len
(
outs
)
==
3
:
cv2
.
RETR_LIST
,
cv2
.
CHAIN_APPROX_SIMPLE
)
img
,
contours
,
_
=
outs
[
0
],
outs
[
1
],
outs
[
2
]
elif
len
(
outs
)
==
2
:
contours
,
_
=
outs
[
0
],
outs
[
1
]
num_contours
=
min
(
len
(
contours
),
self
.
max_candidates
)
num_contours
=
min
(
len
(
contours
),
self
.
max_candidates
)
boxes
=
np
.
zeros
((
num_contours
,
4
,
2
),
dtype
=
np
.
int16
)
boxes
=
np
.
zeros
((
num_contours
,
4
,
2
),
dtype
=
np
.
int16
)
...
...
tools/infer/predict_system.py
View file @
576cbfa7
...
@@ -84,7 +84,7 @@ def sorted_boxes(dt_boxes):
...
@@ -84,7 +84,7 @@ def sorted_boxes(dt_boxes):
"""
"""
Sort text boxes in order from top to bottom, left to right
Sort text boxes in order from top to bottom, left to right
args:
args:
dt_boxes(array)
:
detected text boxes with shape [4, 2]
dt_boxes(array)
:
detected text boxes with shape [4, 2]
return:
return:
sorted boxes(array) with shape [4, 2]
sorted boxes(array) with shape [4, 2]
"""
"""
...
@@ -108,6 +108,7 @@ if __name__ == "__main__":
...
@@ -108,6 +108,7 @@ if __name__ == "__main__":
is_visualize
=
True
is_visualize
=
True
for
image_file
in
image_file_list
:
for
image_file
in
image_file_list
:
img
=
cv2
.
imread
(
image_file
)
img
=
cv2
.
imread
(
image_file
)
print
(
img
.
shape
)
if
img
is
None
:
if
img
is
None
:
logger
.
info
(
"error in loading image:{}"
.
format
(
image_file
))
logger
.
info
(
"error in loading image:{}"
.
format
(
image_file
))
continue
continue
...
...
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