Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleOCR
提交
7009c507
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看板
提交
7009c507
编写于
6月 02, 2021
作者:
qq_25193841
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update joinus.png and PPOCRLabel
上级
1d52345b
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
9 addition
and
4 deletion
+9
-4
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+9
-4
doc/joinus.PNG
doc/joinus.PNG
+0
-0
未找到文件。
PPOCRLabel/PPOCRLabel.py
浏览文件 @
7009c507
...
@@ -92,7 +92,7 @@ class WindowMixin(object):
...
@@ -92,7 +92,7 @@ class WindowMixin(object):
class
MainWindow
(
QMainWindow
,
WindowMixin
):
class
MainWindow
(
QMainWindow
,
WindowMixin
):
FIT_WINDOW
,
FIT_WIDTH
,
MANUAL_ZOOM
=
list
(
range
(
3
))
FIT_WINDOW
,
FIT_WIDTH
,
MANUAL_ZOOM
=
list
(
range
(
3
))
def
__init__
(
self
,
lang
=
"ch"
,
defaultFilename
=
None
,
defaultPrefdefClassFile
=
None
,
defaultSaveDir
=
None
):
def
__init__
(
self
,
lang
=
"ch"
,
gpu
=
False
,
defaultFilename
=
None
,
defaultPrefdefClassFile
=
None
,
defaultSaveDir
=
None
):
super
(
MainWindow
,
self
).
__init__
()
super
(
MainWindow
,
self
).
__init__
()
self
.
setWindowTitle
(
__appname__
)
self
.
setWindowTitle
(
__appname__
)
...
@@ -108,7 +108,7 @@ class MainWindow(QMainWindow, WindowMixin):
...
@@ -108,7 +108,7 @@ class MainWindow(QMainWindow, WindowMixin):
getStr
=
lambda
strId
:
self
.
stringBundle
.
getString
(
strId
)
getStr
=
lambda
strId
:
self
.
stringBundle
.
getString
(
strId
)
self
.
defaultSaveDir
=
defaultSaveDir
self
.
defaultSaveDir
=
defaultSaveDir
self
.
ocr
=
PaddleOCR
(
use_pdserving
=
False
,
use_angle_cls
=
True
,
det
=
True
,
cls
=
True
,
use_gpu
=
False
,
lang
=
lang
)
self
.
ocr
=
PaddleOCR
(
use_pdserving
=
False
,
use_angle_cls
=
True
,
det
=
True
,
cls
=
True
,
use_gpu
=
gpu
,
lang
=
lang
)
if
os
.
path
.
exists
(
'./data/paddle.png'
):
if
os
.
path
.
exists
(
'./data/paddle.png'
):
result
=
self
.
ocr
.
ocr
(
'./data/paddle.png'
,
cls
=
True
,
det
=
True
)
result
=
self
.
ocr
.
ocr
(
'./data/paddle.png'
,
cls
=
True
,
det
=
True
)
...
@@ -1239,6 +1239,8 @@ class MainWindow(QMainWindow, WindowMixin):
...
@@ -1239,6 +1239,8 @@ class MainWindow(QMainWindow, WindowMixin):
def
loadFile
(
self
,
filePath
=
None
):
def
loadFile
(
self
,
filePath
=
None
):
"""Load the specified file, or the last opened file if None."""
"""Load the specified file, or the last opened file if None."""
if
self
.
dirty
:
self
.
mayContinue
()
self
.
resetState
()
self
.
resetState
()
self
.
canvas
.
setEnabled
(
False
)
self
.
canvas
.
setEnabled
(
False
)
if
filePath
is
None
:
if
filePath
is
None
:
...
@@ -2037,6 +2039,8 @@ def read(filename, default=None):
...
@@ -2037,6 +2039,8 @@ def read(filename, default=None):
except
:
except
:
return
default
return
default
def
str2bool
(
v
):
return
v
.
lower
()
in
(
"true"
,
"t"
,
"1"
)
def
get_main_app
(
argv
=
[]):
def
get_main_app
(
argv
=
[]):
"""
"""
...
@@ -2048,13 +2052,14 @@ def get_main_app(argv=[]):
...
@@ -2048,13 +2052,14 @@ def get_main_app(argv=[]):
app
.
setWindowIcon
(
newIcon
(
"app"
))
app
.
setWindowIcon
(
newIcon
(
"app"
))
# Tzutalin 201705+: Accept extra agruments to change predefined class file
# Tzutalin 201705+: Accept extra agruments to change predefined class file
argparser
=
argparse
.
ArgumentParser
()
argparser
=
argparse
.
ArgumentParser
()
argparser
.
add_argument
(
"--lang"
,
default
=
'en'
,
nargs
=
"?"
)
argparser
.
add_argument
(
"--lang"
,
type
=
str
,
default
=
'en'
,
nargs
=
"?"
)
argparser
.
add_argument
(
"--gpu"
,
type
=
str2bool
,
default
=
False
,
nargs
=
"?"
)
argparser
.
add_argument
(
"--predefined_classes_file"
,
argparser
.
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
=
"?"
)
args
=
argparser
.
parse_args
(
argv
[
1
:])
args
=
argparser
.
parse_args
(
argv
[
1
:])
# Usage : labelImg.py image predefClassFile saveDir
# Usage : labelImg.py image predefClassFile saveDir
win
=
MainWindow
(
lang
=
args
.
lang
,
win
=
MainWindow
(
lang
=
args
.
lang
,
gpu
=
args
.
gpu
,
defaultPrefdefClassFile
=
args
.
predefined_classes_file
)
defaultPrefdefClassFile
=
args
.
predefined_classes_file
)
win
.
show
()
win
.
show
()
return
app
,
win
return
app
,
win
...
...
doc/joinus.PNG
查看替换文件 @
1d52345b
浏览文件 @
7009c507
99.7 KB
|
W:
|
H:
101.8 KB
|
W:
|
H:
2-up
Swipe
Onion skin
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录