Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_41840029
PaddleOCR
提交
6989a35e
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看板
未验证
提交
6989a35e
编写于
8月 25, 2022
作者:
E
Evezerest
提交者:
GitHub
8月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7356 from Evezerest/dygraph
Update PPOCRLabel.py
上级
e54e2214
5635385c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
23 deletion
+20
-23
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+3
-6
PPOCRLabel/libs/canvas.py
PPOCRLabel/libs/canvas.py
+1
-1
__init__.py
__init__.py
+1
-1
paddleocr.py
paddleocr.py
+3
-3
ppstructure/pdf2word/pdf2word.py
ppstructure/pdf2word/pdf2word.py
+12
-12
未找到文件。
PPOCRLabel/PPOCRLabel.py
浏览文件 @
6989a35e
...
@@ -2285,7 +2285,7 @@ class MainWindow(QMainWindow):
...
@@ -2285,7 +2285,7 @@ class MainWindow(QMainWindow):
'''
'''
Table Recegnition
Table Recegnition
'''
'''
from
paddleocr
.ppstructure.table.predict_table
import
to_excel
from
paddleocr
import
to_excel
import
time
import
time
...
@@ -2309,7 +2309,7 @@ class MainWindow(QMainWindow):
...
@@ -2309,7 +2309,7 @@ class MainWindow(QMainWindow):
# ONLY SUPPORT ONE TABLE in one image
# ONLY SUPPORT ONE TABLE in one image
hasTable
=
False
hasTable
=
False
for
region
in
res
:
for
region
in
res
:
if
region
[
'type'
]
==
'
T
able'
:
if
region
[
'type'
]
==
'
t
able'
:
if
region
[
'res'
][
'boxes'
]
is
None
:
if
region
[
'res'
][
'boxes'
]
is
None
:
msg
=
'Can not recognise the detection box in '
+
self
.
filePath
+
'. Please change manually'
msg
=
'Can not recognise the detection box in '
+
self
.
filePath
+
'. Please change manually'
QMessageBox
.
information
(
self
,
"Information"
,
msg
)
QMessageBox
.
information
(
self
,
"Information"
,
msg
)
...
@@ -2335,10 +2335,7 @@ class MainWindow(QMainWindow):
...
@@ -2335,10 +2335,7 @@ class MainWindow(QMainWindow):
bbox
=
np
.
array
(
region
[
'res'
][
'boxes'
][
i
])
bbox
=
np
.
array
(
region
[
'res'
][
'boxes'
][
i
])
rec_text
=
region
[
'res'
][
'rec_res'
][
i
][
0
]
rec_text
=
region
[
'res'
][
'rec_res'
][
i
][
0
]
# polys to rectangles
rext_bbox
=
[[
bbox
[
0
],
bbox
[
1
]],
[
bbox
[
2
],
bbox
[
1
]],
[
bbox
[
2
],
bbox
[
3
]],
[
bbox
[
0
],
bbox
[
3
]]]
x1
,
y1
=
np
.
min
(
bbox
[:,
0
]),
np
.
min
(
bbox
[:,
1
])
x2
,
y2
=
np
.
max
(
bbox
[:,
0
]),
np
.
max
(
bbox
[:,
1
])
rext_bbox
=
[[
x1
,
y1
],
[
x2
,
y1
],
[
x2
,
y2
],
[
x1
,
y2
]]
# save bbox to shape
# save bbox to shape
shape
=
Shape
(
label
=
rec_text
,
line_color
=
DEFAULT_LINE_COLOR
,
key_cls
=
None
)
shape
=
Shape
(
label
=
rec_text
,
line_color
=
DEFAULT_LINE_COLOR
,
key_cls
=
None
)
...
...
PPOCRLabel/libs/canvas.py
浏览文件 @
6989a35e
...
@@ -627,7 +627,7 @@ class Canvas(QWidget):
...
@@ -627,7 +627,7 @@ class Canvas(QWidget):
# adaptive BBOX label & index font size
# adaptive BBOX label & index font size
if
self
.
pixmap
:
if
self
.
pixmap
:
h
,
w
=
self
.
pixmap
.
size
().
height
(),
self
.
pixmap
.
size
().
width
()
h
,
w
=
self
.
pixmap
.
size
().
height
(),
self
.
pixmap
.
size
().
width
()
fontszie
=
int
(
max
(
h
,
w
)
/
96
)
fontszie
=
int
(
max
(
h
,
w
)
/
48
)
for
s
in
self
.
shapes
:
for
s
in
self
.
shapes
:
s
.
fontsize
=
fontszie
s
.
fontsize
=
fontszie
...
...
__init__.py
浏览文件 @
6989a35e
...
@@ -17,5 +17,5 @@ __version__ = paddleocr.VERSION
...
@@ -17,5 +17,5 @@ __version__ = paddleocr.VERSION
__all__
=
[
__all__
=
[
'PaddleOCR'
,
'PPStructure'
,
'draw_ocr'
,
'draw_structure_result'
,
'PaddleOCR'
,
'PPStructure'
,
'draw_ocr'
,
'draw_structure_result'
,
'save_structure_res'
,
'download_with_progressbar'
,
'sorted_layout_boxes'
,
'save_structure_res'
,
'download_with_progressbar'
,
'sorted_layout_boxes'
,
'convert_info_docx'
'convert_info_docx'
,
'to_excel'
]
]
paddleocr.py
浏览文件 @
6989a35e
...
@@ -39,15 +39,15 @@ from ppocr.utils.utility import check_and_read, get_image_file_list
...
@@ -39,15 +39,15 @@ from ppocr.utils.utility import check_and_read, get_image_file_list
from
ppocr.utils.network
import
maybe_download
,
download_with_progressbar
,
is_link
,
confirm_model_dir_url
from
ppocr.utils.network
import
maybe_download
,
download_with_progressbar
,
is_link
,
confirm_model_dir_url
from
tools.infer.utility
import
draw_ocr
,
str2bool
,
check_gpu
from
tools.infer.utility
import
draw_ocr
,
str2bool
,
check_gpu
from
ppstructure.utility
import
init_args
,
draw_structure_result
from
ppstructure.utility
import
init_args
,
draw_structure_result
from
ppstructure.predict_system
import
StructureSystem
,
save_structure_res
from
ppstructure.predict_system
import
StructureSystem
,
save_structure_res
,
to_excel
__all__
=
[
__all__
=
[
'PaddleOCR'
,
'PPStructure'
,
'draw_ocr'
,
'draw_structure_result'
,
'PaddleOCR'
,
'PPStructure'
,
'draw_ocr'
,
'draw_structure_result'
,
'save_structure_res'
,
'download_with_progressbar'
'save_structure_res'
,
'download_with_progressbar'
,
'to_excel'
]
]
SUPPORT_DET_MODEL
=
[
'DB'
]
SUPPORT_DET_MODEL
=
[
'DB'
]
VERSION
=
'2.6'
VERSION
=
'2.6
.0.1
'
SUPPORT_REC_MODEL
=
[
'CRNN'
,
'SVTR_LCNet'
]
SUPPORT_REC_MODEL
=
[
'CRNN'
,
'SVTR_LCNet'
]
BASE_DIR
=
os
.
path
.
expanduser
(
"~/.paddleocr/"
)
BASE_DIR
=
os
.
path
.
expanduser
(
"~/.paddleocr/"
)
...
...
ppstructure/pdf2word/pdf2word.py
浏览文件 @
6989a35e
...
@@ -181,7 +181,7 @@ class APP_Image2Doc(QWidget):
...
@@ -181,7 +181,7 @@ class APP_Image2Doc(QWidget):
# settings
# settings
self
.
imagePaths
=
[]
self
.
imagePaths
=
[]
#
self.screenShotWg = ScreenShotWidget()
#
self.screenShotWg = ScreenShotWidget()
self
.
screenShot
=
None
self
.
screenShot
=
None
self
.
save_pdf
=
False
self
.
save_pdf
=
False
self
.
output_dir
=
None
self
.
output_dir
=
None
...
@@ -358,17 +358,17 @@ class APP_Image2Doc(QWidget):
...
@@ -358,17 +358,17 @@ class APP_Image2Doc(QWidget):
self
.
pb
.
setRange
(
0
,
len
(
self
.
imagePaths
))
self
.
pb
.
setRange
(
0
,
len
(
self
.
imagePaths
))
self
.
pb
.
setValue
(
0
)
self
.
pb
.
setValue
(
0
)
#
def screenShotSlot(self):
#
def screenShotSlot(self):
#
'''
#
'''
#
选定图像文件和截图的转换过程只能同时进行一个
#
选定图像文件和截图的转换过程只能同时进行一个
#
截图只能同时转换一个
#
截图只能同时转换一个
#
'''
#
'''
#
self.screenShotWg.start()
#
self.screenShotWg.start()
#
if self.screenShotWg.captureImage:
#
if self.screenShotWg.captureImage:
#
self.screenShot = self.screenShotWg.captureImage
#
self.screenShot = self.screenShotWg.captureImage
#
self.imagePaths.clear() # discard openfile temp list
#
self.imagePaths.clear() # discard openfile temp list
#
self.pb.setRange(0, 1)
#
self.pb.setRange(0, 1)
#
self.pb.setValue(0)
#
self.pb.setValue(0)
def
handleStartSignal
(
self
,
lang
):
def
handleStartSignal
(
self
,
lang
):
if
self
.
screenShot
:
# for screenShot
if
self
.
screenShot
:
# for screenShot
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录