Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
320cb381
"examples/vscode:/vscode.git/clone" did not exist on "83a7bb2aba2d897ab95d96fb03eda10a624080e7"
Commit
320cb381
authored
May 04, 2022
by
whj_dark
Browse files
new
parent
77acb3bf
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
383 additions
and
16 deletions
+383
-16
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+349
-15
PPOCRLabel/libs/utils.py
PPOCRLabel/libs/utils.py
+27
-0
PPOCRLabel/resources/strings/strings-en.properties
PPOCRLabel/resources/strings/strings-en.properties
+3
-0
PPOCRLabel/resources/strings/strings-zh-CN.properties
PPOCRLabel/resources/strings/strings-zh-CN.properties
+4
-1
No files found.
PPOCRLabel/PPOCRLabel.py
View file @
320cb381
This diff is collapsed.
Click to expand it.
PPOCRLabel/libs/utils.py
View file @
320cb381
...
...
@@ -161,6 +161,33 @@ def get_rotate_crop_image(img, points):
print
(
e
)
def
boxPad
(
box
,
imgShape
,
pad
:
int
)
->
np
.
array
:
"""
Pad a box with [pad] pixels on each side.
"""
box
=
np
.
array
(
box
,
dtype
=
np
.
int32
)
box
[
0
][
0
],
box
[
0
][
1
]
=
box
[
0
][
0
]
-
pad
,
box
[
0
][
1
]
-
pad
box
[
1
][
0
],
box
[
1
][
1
]
=
box
[
1
][
0
]
+
pad
,
box
[
1
][
1
]
-
pad
box
[
2
][
0
],
box
[
2
][
1
]
=
box
[
2
][
0
]
+
pad
,
box
[
2
][
1
]
+
pad
box
[
3
][
0
],
box
[
3
][
1
]
=
box
[
3
][
0
]
-
pad
,
box
[
3
][
1
]
+
pad
h
,
w
,
_
=
imgShape
box
[:,
0
]
=
np
.
clip
(
box
[:,
0
],
0
,
w
)
box
[:,
1
]
=
np
.
clip
(
box
[:,
1
],
0
,
h
)
return
box
def
OBB2HBB
(
obb
)
->
np
.
array
:
"""
Convert Oriented Bounding Box to Horizontal Bounding Box.
"""
hbb
=
np
.
zeros
(
4
,
dtype
=
np
.
int32
)
hbb
[
0
]
=
min
(
obb
[:,
0
])
hbb
[
1
]
=
min
(
obb
[:,
1
])
hbb
[
2
]
=
max
(
obb
[:,
0
])
hbb
[
3
]
=
max
(
obb
[:,
1
])
return
hbb
def
stepsInfo
(
lang
=
'en'
):
if
lang
==
'ch'
:
msg
=
"1. 安装与运行:使用上述命令安装与运行程序。
\n
"
\
...
...
PPOCRLabel/resources/strings/strings-en.properties
View file @
320cb381
...
...
@@ -110,3 +110,6 @@ lockBoxDetail=Lock selected box/Unlock all box
keyListTitle
=
Key List
keyDialogTip
=
Enter object label
keyChange
=
Change Box Key
TableRecognition
=
Table Recognition
cellreRecognition
=
Cell Re-Recognition
exportJSON
=
export JSON(PubTabNet)
PPOCRLabel/resources/strings/strings-zh-CN.properties
View file @
320cb381
...
...
@@ -109,4 +109,7 @@ lockBox=锁定框/解除锁定框
lockBoxDetail
=
若当前没有框处于锁定状态则锁定选中的框,若存在锁定框则解除所有锁定框的锁定状态
keyListTitle
=
关键词列表
keyDialogTip
=
请输入类型名称
keyChange
=
更改Box关键字类别
\ No newline at end of file
keyChange
=
更改Box关键字类别
TableRecognition
=
表格识别
cellreRecognition
=
单元格重识别
exportJSON
=
导出表格JSON标注
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment