Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
89c9abf6
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看板
提交
89c9abf6
编写于
2月 20, 2022
作者:
HinGwenWoong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UI add key list
上级
b5c7163e
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
40 addition
and
10 deletion
+40
-10
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+37
-9
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
+1
-0
未找到文件。
PPOCRLabel/PPOCRLabel.py
浏览文件 @
89c9abf6
...
@@ -63,6 +63,7 @@ class MainWindow(QMainWindow):
...
@@ -63,6 +63,7 @@ class MainWindow(QMainWindow):
def
__init__
(
self
,
def
__init__
(
self
,
lang
=
"ch"
,
lang
=
"ch"
,
gpu
=
False
,
gpu
=
False
,
kei_mode
=
False
,
default_filename
=
None
,
default_filename
=
None
,
default_predefined_class_file
=
None
,
default_predefined_class_file
=
None
,
default_save_dir
=
None
):
default_save_dir
=
None
):
...
@@ -76,6 +77,7 @@ class MainWindow(QMainWindow):
...
@@ -76,6 +77,7 @@ class MainWindow(QMainWindow):
self
.
settings
.
load
()
self
.
settings
.
load
()
settings
=
self
.
settings
settings
=
self
.
settings
self
.
lang
=
lang
self
.
lang
=
lang
self
.
kie_mode
=
kei_mode
# Load string bundle for i18n
# Load string bundle for i18n
if
lang
not
in
[
'ch'
,
'en'
]:
if
lang
not
in
[
'ch'
,
'en'
]:
lang
=
'en'
lang
=
'en'
...
@@ -133,11 +135,13 @@ class MainWindow(QMainWindow):
...
@@ -133,11 +135,13 @@ class MainWindow(QMainWindow):
self
.
autoSaveNum
=
5
self
.
autoSaveNum
=
5
# ================== File List ==================
# ================== File List ==================
filelistLayout
=
QVBoxLayout
()
filelistLayout
.
setContentsMargins
(
0
,
0
,
0
,
0
)
self
.
fileListWidget
=
QListWidget
()
self
.
fileListWidget
=
QListWidget
()
self
.
fileListWidget
.
itemClicked
.
connect
(
self
.
fileitemDoubleClicked
)
self
.
fileListWidget
.
itemClicked
.
connect
(
self
.
fileitemDoubleClicked
)
self
.
fileListWidget
.
setIconSize
(
QSize
(
25
,
25
))
self
.
fileListWidget
.
setIconSize
(
QSize
(
25
,
25
))
filelistLayout
=
QVBoxLayout
()
filelistLayout
.
setContentsMargins
(
0
,
0
,
0
,
0
)
filelistLayout
.
addWidget
(
self
.
fileListWidget
)
filelistLayout
.
addWidget
(
self
.
fileListWidget
)
self
.
AutoRecognition
=
QToolButton
()
self
.
AutoRecognition
=
QToolButton
()
...
@@ -158,10 +162,26 @@ class MainWindow(QMainWindow):
...
@@ -158,10 +162,26 @@ class MainWindow(QMainWindow):
self
.
fileDock
.
setWidget
(
fileListContainer
)
self
.
fileDock
.
setWidget
(
fileListContainer
)
self
.
addDockWidget
(
Qt
.
LeftDockWidgetArea
,
self
.
fileDock
)
self
.
addDockWidget
(
Qt
.
LeftDockWidgetArea
,
self
.
fileDock
)
# ================== Key List ==================
if
self
.
kie_mode
:
self
.
keyList
=
QListWidget
()
# self.keyList.itemActivated.connect(self.boxSelectionChanged)
self
.
keyList
.
itemSelectionChanged
.
connect
(
self
.
keyListSelectionChanged
)
self
.
keyList
.
itemDoubleClicked
.
connect
(
self
.
editBox
)
# Connect to itemChanged to detect checkbox changes.
self
.
keyList
.
itemChanged
.
connect
(
self
.
keyListItemChanged
)
self
.
keyListDockName
=
getStr
(
'keyListTitle'
)
self
.
keyListDock
=
QDockWidget
(
self
.
keyListDockName
,
self
)
self
.
keyListDock
.
setWidget
(
self
.
keyList
)
self
.
keyListDock
.
setFeatures
(
QDockWidget
.
NoDockWidgetFeatures
)
filelistLayout
.
addWidget
(
self
.
keyListDock
)
# ================== Right Area ==================
# ================== Right Area ==================
listLayout
=
QVBoxLayout
()
listLayout
=
QVBoxLayout
()
listLayout
.
setContentsMargins
(
0
,
0
,
0
,
0
)
listLayout
.
setContentsMargins
(
0
,
0
,
0
,
0
)
# Buttons
self
.
editButton
=
QToolButton
()
self
.
editButton
=
QToolButton
()
self
.
reRecogButton
=
QToolButton
()
self
.
reRecogButton
=
QToolButton
()
self
.
reRecogButton
.
setIcon
(
newIcon
(
'reRec'
,
30
))
self
.
reRecogButton
.
setIcon
(
newIcon
(
'reRec'
,
30
))
...
@@ -174,12 +194,12 @@ class MainWindow(QMainWindow):
...
@@ -174,12 +194,12 @@ class MainWindow(QMainWindow):
self
.
DelButton
=
QToolButton
()
self
.
DelButton
=
QToolButton
()
self
.
DelButton
.
setToolButtonStyle
(
Qt
.
ToolButtonTextBesideIcon
)
self
.
DelButton
.
setToolButtonStyle
(
Qt
.
ToolButtonTextBesideIcon
)
left
toptoolb
ox
=
QHBoxLayout
()
left
TopToolB
ox
=
QHBoxLayout
()
left
toptoolb
ox
.
addWidget
(
self
.
newButton
)
left
TopToolB
ox
.
addWidget
(
self
.
newButton
)
left
toptoolb
ox
.
addWidget
(
self
.
reRecogButton
)
left
TopToolB
ox
.
addWidget
(
self
.
reRecogButton
)
left
toptoolboxc
ontainer
=
QWidget
()
left
TopToolBoxC
ontainer
=
QWidget
()
left
toptoolboxcontainer
.
setLayout
(
lefttoptoolb
ox
)
left
TopToolBoxContainer
.
setLayout
(
leftTopToolB
ox
)
listLayout
.
addWidget
(
left
toptoolboxc
ontainer
)
listLayout
.
addWidget
(
left
TopToolBoxC
ontainer
)
# ================== Label List ==================
# ================== Label List ==================
# Create and add a widget for showing current label items
# Create and add a widget for showing current label items
...
@@ -1114,6 +1134,12 @@ class MainWindow(QMainWindow):
...
@@ -1114,6 +1134,12 @@ class MainWindow(QMainWindow):
else
:
else
:
self
.
canvas
.
deSelectShape
()
self
.
canvas
.
deSelectShape
()
def
keyListSelectionChanged
(
self
):
pass
def
keyListItemChanged
(
self
):
pass
def
boxSelectionChanged
(
self
):
def
boxSelectionChanged
(
self
):
if
self
.
_noSelectionSlot
:
if
self
.
_noSelectionSlot
:
# self.BoxList.scrollToItem(self.currentBox(), QAbstractItemView.PositionAtCenter)
# self.BoxList.scrollToItem(self.currentBox(), QAbstractItemView.PositionAtCenter)
...
@@ -2177,8 +2203,9 @@ def get_main_app(argv=[]):
...
@@ -2177,8 +2203,9 @@ def get_main_app(argv=[]):
app
.
setWindowIcon
(
newIcon
(
"app"
))
app
.
setWindowIcon
(
newIcon
(
"app"
))
# Tzutalin 201705+: Accept extra arguments to change predefined class file
# Tzutalin 201705+: Accept extra arguments to change predefined class file
arg_parser
=
argparse
.
ArgumentParser
()
arg_parser
=
argparse
.
ArgumentParser
()
arg_parser
.
add_argument
(
"--lang"
,
type
=
str
,
default
=
'
en
'
,
nargs
=
"?"
)
arg_parser
.
add_argument
(
"--lang"
,
type
=
str
,
default
=
'
ch
'
,
nargs
=
"?"
)
arg_parser
.
add_argument
(
"--gpu"
,
type
=
str2bool
,
default
=
True
,
nargs
=
"?"
)
arg_parser
.
add_argument
(
"--gpu"
,
type
=
str2bool
,
default
=
True
,
nargs
=
"?"
)
arg_parser
.
add_argument
(
"--kie"
,
type
=
str2bool
,
default
=
True
,
nargs
=
"?"
)
arg_parser
.
add_argument
(
"--predefined_classes_file"
,
arg_parser
.
add_argument
(
"--predefined_classes_file"
,
default
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"data"
,
"predefined_classes.txt"
),
default
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"data"
,
"predefined_classes.txt"
),
nargs
=
"?"
)
nargs
=
"?"
)
...
@@ -2186,6 +2213,7 @@ def get_main_app(argv=[]):
...
@@ -2186,6 +2213,7 @@ def get_main_app(argv=[]):
win
=
MainWindow
(
lang
=
args
.
lang
,
win
=
MainWindow
(
lang
=
args
.
lang
,
gpu
=
args
.
gpu
,
gpu
=
args
.
gpu
,
kei_mode
=
args
.
kie
,
default_predefined_class_file
=
args
.
predefined_classes_file
)
default_predefined_class_file
=
args
.
predefined_classes_file
)
win
.
show
()
win
.
show
()
return
app
,
win
return
app
,
win
...
...
PPOCRLabel/resources/strings/strings-en.properties
浏览文件 @
89c9abf6
...
@@ -107,3 +107,4 @@ undoLastPoint=Undo Last Point
...
@@ -107,3 +107,4 @@ undoLastPoint=Undo Last Point
autoSaveMode
=
Auto Export Label Mode
autoSaveMode
=
Auto Export Label Mode
lockBox
=
Lock selected box/Unlock all box
lockBox
=
Lock selected box/Unlock all box
lockBoxDetail
=
Lock selected box/Unlock all box
lockBoxDetail
=
Lock selected box/Unlock all box
keyListTitle
=
Key List
\ No newline at end of file
PPOCRLabel/resources/strings/strings-zh-CN.properties
浏览文件 @
89c9abf6
...
@@ -107,3 +107,4 @@ undoLastPoint=撤销上个点
...
@@ -107,3 +107,4 @@ undoLastPoint=撤销上个点
autoSaveMode
=
自动导出标记结果
autoSaveMode
=
自动导出标记结果
lockBox
=
锁定框/解除锁定框
lockBox
=
锁定框/解除锁定框
lockBoxDetail
=
若当前没有框处于锁定状态则锁定选中的框,若存在锁定框则解除所有锁定框的锁定状态
lockBoxDetail
=
若当前没有框处于锁定状态则锁定选中的框,若存在锁定框则解除所有锁定框的锁定状态
keyListTitle
=
关键词列表
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录