Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_41840029
PaddleOCR
提交
864af3db
P
PaddleOCR
项目概览
weixin_41840029
/
PaddleOCR
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleOCR
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
864af3db
编写于
6月 05, 2021
作者:
W
WenmuZhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复whl包bug
上级
8f50ceb0
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
39 addition
and
16 deletion
+39
-16
MANIFEST.in
MANIFEST.in
+1
-1
ppstructure/MANIFEST.in
ppstructure/MANIFEST.in
+3
-3
ppstructure/README_ch.md
ppstructure/README_ch.md
+1
-0
ppstructure/paddlestructure.py
ppstructure/paddlestructure.py
+20
-5
ppstructure/setup.py
ppstructure/setup.py
+11
-4
ppstructure/table/README_ch.md
ppstructure/table/README_ch.md
+1
-1
ppstructure/table/predict_table.py
ppstructure/table/predict_table.py
+2
-2
未找到文件。
MANIFEST.in
浏览文件 @
864af3db
include LICENSE
.txt
include LICENSE
include README.md
include README.md
recursive-include ppocr/utils *.txt utility.py logging.py network.py
recursive-include ppocr/utils *.txt utility.py logging.py network.py
...
...
ppstructure/MANIFEST.in
浏览文件 @
864af3db
include LICENSE
.txt
include LICENSE
include README.md
include README.md
recursive-include ppocr/utils *.txt utility.py logging.py network.py
recursive-include ppocr/utils *.txt utility.py logging.py network.py
recursive-include ppocr/data/ *.py
recursive-include ppocr/data/ *.py
recursive-include ppocr/postprocess *.py
recursive-include ppocr/postprocess *.py
recursive-include tools/infer *.py
recursive-include tools/infer *.py
recursive-include table *.py
recursive-include ppstructure *.py
recursive-include ppstructure *.py
ppstructure/README_ch.md
浏览文件 @
864af3db
# TableStructurer
\ No newline at end of file
ppstructure/paddlestructure.py
浏览文件 @
864af3db
...
@@ -16,15 +16,15 @@ import os
...
@@ -16,15 +16,15 @@ import os
import
sys
import
sys
__dir__
=
os
.
path
.
dirname
(
__file__
)
__dir__
=
os
.
path
.
dirname
(
__file__
)
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
''
)
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'..'
))
import
cv2
import
cv2
import
numpy
as
np
import
numpy
as
np
from
pathlib
import
Path
from
pathlib
import
Path
from
ppocr.utils.logging
import
get_logger
from
ppocr.utils.logging
import
get_logger
from
predict_system
import
OCRSystem
,
save_res
from
p
pstructure.p
redict_system
import
OCRSystem
,
save_res
from
utility
import
init_args
from
utility
import
init_args
logger
=
get_logger
()
logger
=
get_logger
()
...
@@ -93,9 +93,11 @@ class PaddleStructure(OCRSystem):
...
@@ -93,9 +93,11 @@ class PaddleStructure(OCRSystem):
params
.
rec_char_dict_path
=
str
(
Path
(
__file__
).
parent
.
parent
/
'ppocr/utils/dict/table_dict.txt'
)
params
.
rec_char_dict_path
=
str
(
Path
(
__file__
).
parent
.
parent
/
'ppocr/utils/dict/table_dict.txt'
)
if
params
.
structure_char_dict_path
is
None
:
if
params
.
structure_char_dict_path
is
None
:
if
os
.
path
.
exists
(
str
(
Path
(
__file__
).
parent
/
'ppocr/utils/dict/table_structure_dict.txt'
)):
if
os
.
path
.
exists
(
str
(
Path
(
__file__
).
parent
/
'ppocr/utils/dict/table_structure_dict.txt'
)):
params
.
structure_char_dict_path
=
str
(
Path
(
__file__
).
parent
/
'ppocr/utils/dict/table_structure_dict.txt'
)
params
.
structure_char_dict_path
=
str
(
Path
(
__file__
).
parent
/
'ppocr/utils/dict/table_structure_dict.txt'
)
else
:
else
:
params
.
structure_char_dict_path
=
str
(
Path
(
__file__
).
parent
.
parent
/
'ppocr/utils/dict/table_structure_dict.txt'
)
params
.
structure_char_dict_path
=
str
(
Path
(
__file__
).
parent
.
parent
/
'ppocr/utils/dict/table_structure_dict.txt'
)
print
(
params
)
print
(
params
)
super
().
__init__
(
params
)
super
().
__init__
(
params
)
...
@@ -146,3 +148,16 @@ def main():
...
@@ -146,3 +148,16 @@ def main():
logger
.
info
(
item
[
'res'
])
logger
.
info
(
item
[
'res'
])
save_res
(
result
,
save_folder
,
img_name
)
save_res
(
result
,
save_folder
,
img_name
)
logger
.
info
(
'result save to {}'
.
format
(
os
.
path
.
join
(
save_folder
,
img_name
)))
logger
.
info
(
'result save to {}'
.
format
(
os
.
path
.
join
(
save_folder
,
img_name
)))
if
__name__
==
'__main__'
:
table_engine
=
PaddleStructure
(
det_model_dir
=
'/Users/zhoujun20/Desktop/工作相关/table/table_pr/PaddleOCR/inference/table/ch_ppocr_mobile_v2.0_table_det_infer'
,
rec_model_dir
=
'/Users/zhoujun20/Desktop/工作相关/table/table_pr/PaddleOCR/inference/table/ch_ppocr_mobile_v2.0_table_rec_infer'
,
structure_model_dir
=
'/Users/zhoujun20/Desktop/工作相关/table/table_pr/PaddleOCR/inference/table/ch_ppocr_mobile_v2.0_table_structure_infer'
,
output
=
'/Users/zhoujun20/Desktop/工作相关/table/table_pr/PaddleOCR/output/table'
,
show_log
=
True
)
img
=
cv2
.
imread
(
'/Users/zhoujun20/Desktop/工作相关/table/table_pr/PaddleOCR/ppstructure/test_imgs/table_1.png'
)
result
=
table_engine
(
img
)
for
line
in
result
:
print
(
line
)
ppstructure/setup.py
浏览文件 @
864af3db
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
os
from
setuptools
import
setup
from
setuptools
import
setup
from
io
import
open
from
io
import
open
...
@@ -20,6 +21,7 @@ with open('../requirements.txt', encoding="utf-8-sig") as f:
...
@@ -20,6 +21,7 @@ with open('../requirements.txt', encoding="utf-8-sig") as f:
requirements
=
f
.
readlines
()
requirements
=
f
.
readlines
()
requirements
.
append
(
'tqdm'
)
requirements
.
append
(
'tqdm'
)
requirements
.
append
(
'layoutparser'
)
requirements
.
append
(
'layoutparser'
)
requirements
.
append
(
'iopath'
)
def
readme
():
def
readme
():
...
@@ -27,9 +29,13 @@ def readme():
...
@@ -27,9 +29,13 @@ def readme():
README
=
f
.
read
()
README
=
f
.
read
()
return
README
return
README
shutil
.
copytree
(
'../ppocr'
,
'./ppocr'
)
shutil
.
copytree
(
'../tools'
,
'./tools'
)
shutil
.
copytree
(
'../ppstructure/table'
,
'./ppstructure/table'
)
shutil
.
copytree
(
'../ppstructure'
,
'./ppstructure'
)
shutil
.
copyfile
(
'../ppstructure/predict_system.py'
,
'./ppstructure/predict_system.py'
)
shutil
.
copyfile
(
'../ppstructure/utility.py'
,
'./ppstructure/utility.py'
)
shutil
.
copytree
(
'../ppocr'
,
'./ppocr'
)
shutil
.
copytree
(
'../tools'
,
'./tools'
)
shutil
.
copyfile
(
'../LICENSE'
,
'./LICENSE'
)
setup
(
setup
(
name
=
'paddlestructure'
,
name
=
'paddlestructure'
,
...
@@ -63,3 +69,4 @@ setup(
...
@@ -63,3 +69,4 @@ setup(
shutil
.
rmtree
(
'ppocr'
)
shutil
.
rmtree
(
'ppocr'
)
shutil
.
rmtree
(
'tools'
)
shutil
.
rmtree
(
'tools'
)
shutil
.
rmtree
(
'ppstructure'
)
shutil
.
rmtree
(
'ppstructure'
)
os
.
remove
(
'LICENSE'
)
ppstructure/table/README_ch.md
浏览文件 @
864af3db
...
@@ -8,7 +8,7 @@ python3 table/predict_table.py --det_model_dir=../inference/db --rec_model_dir=.
...
@@ -8,7 +8,7 @@ python3 table/predict_table.py --det_model_dir=../inference/db --rec_model_dir=.
```
```
运行完成后,每张图片的excel表格会保存到table_output字段指定的目录下
运行完成后,每张图片的excel表格会保存到table_output字段指定的目录下
eval
评估
```
python
```
python
python3
table
/
eval_table
.
py
--
det_model_dir
=
..
/
inference
/
db
--
rec_model_dir
=
..
/
inference
/
rec_mv3_large1
.
0
/
infer
--
table_model_dir
=
..
/
inference
/
explite3
/
infer
--
image_dir
=
..
/
table
/
imgs
--
rec_char_dict_path
=
..
/
ppocr
/
utils
/
dict
/
table_dict
.
txt
--
table_char_dict_path
=
..
/
ppocr
/
utils
/
dict
/
table_structure_dict
.
txt
--
rec_char_type
=
EN
--
det_limit_side_len
=
736
--
det_limit_type
=
min
--
gt_path
=
path
/
to
/
gt
.
json
python3
table
/
eval_table
.
py
--
det_model_dir
=
..
/
inference
/
db
--
rec_model_dir
=
..
/
inference
/
rec_mv3_large1
.
0
/
infer
--
table_model_dir
=
..
/
inference
/
explite3
/
infer
--
image_dir
=
..
/
table
/
imgs
--
rec_char_dict_path
=
..
/
ppocr
/
utils
/
dict
/
table_dict
.
txt
--
table_char_dict_path
=
..
/
ppocr
/
utils
/
dict
/
table_structure_dict
.
txt
--
rec_char_type
=
EN
--
det_limit_side_len
=
736
--
det_limit_type
=
min
--
gt_path
=
path
/
to
/
gt
.
json
...
...
ppstructure/table/predict_table.py
浏览文件 @
864af3db
...
@@ -28,11 +28,11 @@ import numpy as np
...
@@ -28,11 +28,11 @@ import numpy as np
import
time
import
time
import
tools.infer.predict_rec
as
predict_rec
import
tools.infer.predict_rec
as
predict_rec
import
tools.infer.predict_det
as
predict_det
import
tools.infer.predict_det
as
predict_det
import
ppstructure.table.predict_structure
as
predict_strture
from
ppocr.utils.utility
import
get_image_file_list
,
check_and_read_gif
from
ppocr.utils.utility
import
get_image_file_list
,
check_and_read_gif
from
ppocr.utils.logging
import
get_logger
from
ppocr.utils.logging
import
get_logger
from
matcher
import
distance
,
compute_iou
from
ppstructure.table.
matcher
import
distance
,
compute_iou
from
ppstructure.utility
import
parse_args
from
ppstructure.utility
import
parse_args
import
ppstructure.table.predict_structure
as
predict_strture
logger
=
get_logger
()
logger
=
get_logger
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录