Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
b09e4f39
P
PaddleOCR
项目概览
PaddlePaddle
/
PaddleOCR
大约 1 年 前同步成功
通知
1528
Star
32962
Fork
6643
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
108
列表
看板
标记
里程碑
合并请求
7
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
108
Issue
108
列表
看板
标记
里程碑
合并请求
7
合并请求
7
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b09e4f39
编写于
4月 15, 2021
作者:
qq_25193841
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix several bugs in PPOCRLabel
Fix several bugs in PPOCRLabel
上级
5d85cc8d
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
11008 addition
and
10994 deletion
+11008
-10994
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+20
-10
PPOCRLabel/libs/canvas.py
PPOCRLabel/libs/canvas.py
+1
-1
PPOCRLabel/libs/resources.py
PPOCRLabel/libs/resources.py
+10984
-10982
PPOCRLabel/resources/strings/strings-zh-CN.properties
PPOCRLabel/resources/strings/strings-zh-CN.properties
+1
-0
PPOCRLabel/resources/strings/strings.properties
PPOCRLabel/resources/strings/strings.properties
+2
-1
未找到文件。
PPOCRLabel/PPOCRLabel.py
浏览文件 @
b09e4f39
...
@@ -147,6 +147,7 @@ class MainWindow(QMainWindow, WindowMixin):
...
@@ -147,6 +147,7 @@ class MainWindow(QMainWindow, WindowMixin):
self
.
itemsToShapesbox
=
{}
self
.
itemsToShapesbox
=
{}
self
.
shapesToItemsbox
=
{}
self
.
shapesToItemsbox
=
{}
self
.
prevLabelText
=
getStr
(
'tempLabel'
)
self
.
prevLabelText
=
getStr
(
'tempLabel'
)
self
.
noLabelText
=
getStr
(
'nullLabel'
)
self
.
model
=
'paddle'
self
.
model
=
'paddle'
self
.
PPreader
=
None
self
.
PPreader
=
None
self
.
autoSaveNum
=
5
self
.
autoSaveNum
=
5
...
@@ -1020,7 +1021,7 @@ class MainWindow(QMainWindow, WindowMixin):
...
@@ -1020,7 +1021,7 @@ class MainWindow(QMainWindow, WindowMixin):
item
.
setText
(
str
([(
int
(
p
.
x
()),
int
(
p
.
y
()))
for
p
in
shape
.
points
]))
item
.
setText
(
str
([(
int
(
p
.
x
()),
int
(
p
.
y
()))
for
p
in
shape
.
points
]))
self
.
updateComboBox
()
self
.
updateComboBox
()
def
updateComboBox
(
self
):
# TODO:貌似没用
def
updateComboBox
(
self
):
# Get the unique labels and add them to the Combobox.
# Get the unique labels and add them to the Combobox.
itemsTextList
=
[
str
(
self
.
labelList
.
item
(
i
).
text
())
for
i
in
range
(
self
.
labelList
.
count
())]
itemsTextList
=
[
str
(
self
.
labelList
.
item
(
i
).
text
())
for
i
in
range
(
self
.
labelList
.
count
())]
...
@@ -1040,7 +1041,7 @@ class MainWindow(QMainWindow, WindowMixin):
...
@@ -1040,7 +1041,7 @@ class MainWindow(QMainWindow, WindowMixin):
return
dict
(
label
=
s
.
label
,
# str
return
dict
(
label
=
s
.
label
,
# str
line_color
=
s
.
line_color
.
getRgb
(),
line_color
=
s
.
line_color
.
getRgb
(),
fill_color
=
s
.
fill_color
.
getRgb
(),
fill_color
=
s
.
fill_color
.
getRgb
(),
points
=
[(
p
.
x
(),
p
.
y
(
))
for
p
in
s
.
points
],
# QPonitF
points
=
[(
int
(
p
.
x
()),
int
(
p
.
y
()
))
for
p
in
s
.
points
],
# QPonitF
# add chris
# add chris
difficult
=
s
.
difficult
)
# bool
difficult
=
s
.
difficult
)
# bool
...
@@ -1069,7 +1070,7 @@ class MainWindow(QMainWindow, WindowMixin):
...
@@ -1069,7 +1070,7 @@ class MainWindow(QMainWindow, WindowMixin):
# print('Image:{0} -> Annotation:{1}'.format(self.filePath, annotationFilePath))
# print('Image:{0} -> Annotation:{1}'.format(self.filePath, annotationFilePath))
return
True
return
True
except
:
except
:
self
.
errorMessage
(
u
'Error saving label data'
)
self
.
errorMessage
(
u
'Error saving label data'
,
u
'Error saving label data'
)
return
False
return
False
def
copySelectedShape
(
self
):
def
copySelectedShape
(
self
):
...
@@ -1802,10 +1803,14 @@ class MainWindow(QMainWindow, WindowMixin):
...
@@ -1802,10 +1803,14 @@ class MainWindow(QMainWindow, WindowMixin):
result
.
insert
(
0
,
box
)
result
.
insert
(
0
,
box
)
print
(
'result in reRec is '
,
result
)
print
(
'result in reRec is '
,
result
)
self
.
result_dic
.
append
(
result
)
self
.
result_dic
.
append
(
result
)
if
result
[
1
][
0
]
==
shape
.
label
:
else
:
print
(
'label no change'
)
print
(
'Can not recognise the box'
)
else
:
self
.
result_dic
.
append
([
box
,(
self
.
noLabelText
,
0
)])
rec_flag
+=
1
if
self
.
noLabelText
==
shape
.
label
or
result
[
1
][
0
]
==
shape
.
label
:
print
(
'label no change'
)
else
:
rec_flag
+=
1
if
len
(
self
.
result_dic
)
>
0
and
rec_flag
>
0
:
if
len
(
self
.
result_dic
)
>
0
and
rec_flag
>
0
:
self
.
saveFile
(
mode
=
'Auto'
)
self
.
saveFile
(
mode
=
'Auto'
)
...
@@ -1836,9 +1841,14 @@ class MainWindow(QMainWindow, WindowMixin):
...
@@ -1836,9 +1841,14 @@ class MainWindow(QMainWindow, WindowMixin):
print
(
'label no change'
)
print
(
'label no change'
)
else
:
else
:
shape
.
label
=
result
[
1
][
0
]
shape
.
label
=
result
[
1
][
0
]
self
.
singleLabel
(
shape
)
else
:
self
.
setDirty
()
print
(
'Can not recognise the box'
)
print
(
box
)
if
self
.
noLabelText
==
shape
.
label
:
print
(
'label no change'
)
else
:
shape
.
label
=
self
.
noLabelText
self
.
singleLabel
(
shape
)
self
.
setDirty
()
def
autolcm
(
self
):
def
autolcm
(
self
):
vbox
=
QVBoxLayout
()
vbox
=
QVBoxLayout
()
...
...
PPOCRLabel/libs/canvas.py
浏览文件 @
b09e4f39
...
@@ -45,7 +45,7 @@ class Canvas(QWidget):
...
@@ -45,7 +45,7 @@ class Canvas(QWidget):
CREATE
,
EDIT
=
list
(
range
(
2
))
CREATE
,
EDIT
=
list
(
range
(
2
))
_fill_drawing
=
False
# draw shadows
_fill_drawing
=
False
# draw shadows
epsilon
=
11
.0
epsilon
=
5
.0
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
Canvas
,
self
).
__init__
(
*
args
,
**
kwargs
)
super
(
Canvas
,
self
).
__init__
(
*
args
,
**
kwargs
)
...
...
PPOCRLabel/libs/resources.py
浏览文件 @
b09e4f39
此差异已折叠。
点击以展开。
PPOCRLabel/resources/strings/strings-zh-CN.properties
浏览文件 @
b09e4f39
...
@@ -87,6 +87,7 @@ creatPolygon=四点标注
...
@@ -87,6 +87,7 @@ creatPolygon=四点标注
drawSquares
=
正方形标注
drawSquares
=
正方形标注
saveRec
=
保存识别结果
saveRec
=
保存识别结果
tempLabel
=
待识别
tempLabel
=
待识别
nullLabel
=
无法识别
steps
=
操作步骤
steps
=
操作步骤
choseModelLg
=
选择模型语言
choseModelLg
=
选择模型语言
cancel
=
取消
cancel
=
取消
...
...
PPOCRLabel/resources/strings/strings.properties
浏览文件 @
b09e4f39
...
@@ -77,7 +77,7 @@ IR=Image Resize
...
@@ -77,7 +77,7 @@ IR=Image Resize
autoRecognition
=
Auto Recognition
autoRecognition
=
Auto Recognition
reRecognition
=
Re-recognition
reRecognition
=
Re-recognition
mfile
=
File
mfile
=
File
medit
=
E
id
t
medit
=
E
di
t
mview
=
View
mview
=
View
mhelp
=
Help
mhelp
=
Help
iconList
=
Icon List
iconList
=
Icon List
...
@@ -87,6 +87,7 @@ creatPolygon=Create Quadrilateral
...
@@ -87,6 +87,7 @@ creatPolygon=Create Quadrilateral
drawSquares
=
Draw Squares
drawSquares
=
Draw Squares
saveRec
=
Save Recognition Result
saveRec
=
Save Recognition Result
tempLabel
=
TEMPORARY
tempLabel
=
TEMPORARY
nullLabel
=
NULL
steps
=
Steps
steps
=
Steps
choseModelLg
=
Choose Model Language
choseModelLg
=
Choose Model Language
cancel
=
Cancel
cancel
=
Cancel
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录