Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleOCR
提交
814e8a87
P
PaddleOCR
项目概览
s920243400
/
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看板
提交
814e8a87
编写于
2月 20, 2022
作者:
HinGwenWoong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Delete useless part in key dialog, translate tip
上级
77d83a60
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
27 deletion
+13
-27
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+5
-4
PPOCRLabel/libs/keyDialog.py
PPOCRLabel/libs/keyDialog.py
+4
-21
PPOCRLabel/resources/strings/strings-en.properties
PPOCRLabel/resources/strings/strings-en.properties
+2
-1
PPOCRLabel/resources/strings/strings-zh-CN.properties
PPOCRLabel/resources/strings/strings-zh-CN.properties
+2
-1
未找到文件。
PPOCRLabel/PPOCRLabel.py
浏览文件 @
814e8a87
...
...
@@ -80,6 +80,7 @@ class MainWindow(QMainWindow):
settings
=
self
.
settings
self
.
lang
=
lang
self
.
kie_mode
=
kie_mode
self
.
key_previous_text
=
""
# Load string bundle for i18n
if
lang
not
in
[
'ch'
,
'en'
]:
lang
=
'en'
...
...
@@ -428,6 +429,7 @@ class MainWindow(QMainWindow):
# key list dialog
if
kie_mode
:
self
.
keyDialog
=
KeyDialog
(
text
=
getStr
(
'keyDialogTip'
),
parent
=
self
,
labels
=
None
,
sort_labels
=
True
,
...
...
@@ -1219,10 +1221,9 @@ class MainWindow(QMainWindow):
self
.
canvas
.
resetAllLines
()
if
self
.
kie_mode
:
previous_text
=
self
.
keyDialog
.
edit
.
text
()
text
,
flags
,
group_id
=
self
.
keyDialog
.
popUp
(
text
)
if
not
text
:
self
.
keyDialog
.
edit
.
setText
(
previous_text
)
self
.
key_previous_text
,
flags
=
self
.
keyDialog
.
popUp
(
self
.
key_previous_text
)
if
not
self
.
key_previous_text
:
self
.
keyDialog
.
edit
.
setText
(
self
.
key_previous_text
)
def
scrollRequest
(
self
,
delta
,
orientation
):
units
=
-
delta
/
(
8
*
15
)
...
...
PPOCRLabel/libs/keyDialog.py
浏览文件 @
814e8a87
import
re
import
sys
from
PyQt5
import
QtCore
from
PyQt5
import
QtGui
from
PyQt5
import
QtWidgets
from
libs.utils
import
newIcon
,
labelValidator
QT5
=
True
...
...
@@ -49,16 +46,11 @@ class KeyDialog(QtWidgets.QDialog):
self
.
edit
.
editingFinished
.
connect
(
self
.
postProcess
)
if
flags
:
self
.
edit
.
textChanged
.
connect
(
self
.
updateFlags
)
self
.
edit_group_id
=
QtWidgets
.
QLineEdit
()
self
.
edit_group_id
.
setPlaceholderText
(
"Group ID"
)
self
.
edit_group_id
.
setValidator
(
QtGui
.
QRegExpValidator
(
QtCore
.
QRegExp
(
r
"\d*"
),
None
)
)
layout
=
QtWidgets
.
QVBoxLayout
()
if
show_text_field
:
layout_edit
=
QtWidgets
.
QHBoxLayout
()
layout_edit
.
addWidget
(
self
.
edit
,
6
)
layout_edit
.
addWidget
(
self
.
edit_group_id
,
2
)
layout
.
addLayout
(
layout_edit
)
# buttons
self
.
buttonBox
=
bb
=
QtWidgets
.
QDialogButtonBox
(
...
...
@@ -189,13 +181,7 @@ class KeyDialog(QtWidgets.QDialog):
flags
[
item
.
text
()]
=
item
.
isChecked
()
return
flags
def
getGroupId
(
self
):
group_id
=
self
.
edit_group_id
.
text
()
if
group_id
:
return
int
(
group_id
)
return
None
def
popUp
(
self
,
text
=
None
,
move
=
True
,
flags
=
None
,
group_id
=
None
):
def
popUp
(
self
,
text
=
None
,
move
=
True
,
flags
=
None
):
if
self
.
_fit_to_content
[
"row"
]:
self
.
labelList
.
setMinimumHeight
(
self
.
labelList
.
sizeHintForRow
(
0
)
*
self
.
labelList
.
count
()
+
2
...
...
@@ -213,10 +199,7 @@ class KeyDialog(QtWidgets.QDialog):
self
.
resetFlags
(
text
)
self
.
edit
.
setText
(
text
)
self
.
edit
.
setSelection
(
0
,
len
(
text
))
if
group_id
is
None
:
self
.
edit_group_id
.
clear
()
else
:
self
.
edit_group_id
.
setText
(
str
(
group_id
))
items
=
self
.
labelList
.
findItems
(
text
,
QtCore
.
Qt
.
MatchFixedString
)
if
items
:
if
len
(
items
)
!=
1
:
...
...
@@ -227,6 +210,6 @@ class KeyDialog(QtWidgets.QDialog):
if
move
:
self
.
move
(
QtGui
.
QCursor
.
pos
())
if
self
.
exec_
():
return
self
.
edit
.
text
(),
self
.
getFlags
()
,
self
.
getGroupId
()
return
self
.
edit
.
text
(),
self
.
getFlags
()
else
:
return
None
,
None
,
None
PPOCRLabel/resources/strings/strings-en.properties
浏览文件 @
814e8a87
...
...
@@ -107,4 +107,5 @@ undoLastPoint=Undo Last Point
autoSaveMode
=
Auto Export Label Mode
lockBox
=
Lock selected box/Unlock all box
lockBoxDetail
=
Lock selected box/Unlock all box
keyListTitle
=
Key List
\ No newline at end of file
keyListTitle
=
Key List
keyDialogTip
=
Enter object label
\ No newline at end of file
PPOCRLabel/resources/strings/strings-zh-CN.properties
浏览文件 @
814e8a87
...
...
@@ -107,4 +107,5 @@ undoLastPoint=撤销上个点
autoSaveMode
=
自动导出标记结果
lockBox
=
锁定框/解除锁定框
lockBoxDetail
=
若当前没有框处于锁定状态则锁定选中的框,若存在锁定框则解除所有锁定框的锁定状态
keyListTitle
=
关键词列表
\ No newline at end of file
keyListTitle
=
关键词列表
keyDialogTip
=
请输入类型名称
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录