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
0667daa3
Commit
0667daa3
authored
May 13, 2022
by
Leif
Browse files
Update PPOCRLabel
Update PPOCRLabel
parent
01ebe4a5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11356 additions
and
11330 deletions
+11356
-11330
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+1
-15
PPOCRLabel/libs/resources.py
PPOCRLabel/libs/resources.py
+11351
-11311
PPOCRLabel/libs/utils.py
PPOCRLabel/libs/utils.py
+2
-2
PPOCRLabel/resources/strings/strings-en.properties
PPOCRLabel/resources/strings/strings-en.properties
+1
-1
PPOCRLabel/resources/strings/strings-zh-CN.properties
PPOCRLabel/resources/strings/strings-zh-CN.properties
+1
-1
No files found.
PPOCRLabel/PPOCRLabel.py
View file @
0667daa3
...
...
@@ -2336,13 +2336,6 @@ class MainWindow(QMainWindow):
else
:
labeldict
[
file
]
=
[]
# if len(labeldict) != len(csv_paths):
# msg = 'ERROR, box label and excel label are not in the same number\n' + \
# 'box label: ' + str(len(labeldict)) + '\n' + \
# 'excel label: ' + str(len(csv_paths)) + '\n' + \
# 'Please check the label.txt and tableRec_excel_output\n'
# QMessageBox.information(self, "Information", msg)
# return
train_split
,
val_split
,
test_split
=
partitionDialog
.
getDataPartition
()
# check validate
if
train_split
+
val_split
+
test_split
>
100
:
...
...
@@ -2365,14 +2358,8 @@ class MainWindow(QMainWindow):
filename
,
_
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
image_path
))
csv_path
=
os
.
path
.
join
(
TableRec_excel_dir
,
filename
+
'.xlsx'
)
if
not
os
.
path
.
exists
(
csv_path
):
msg
=
'ERROR, Can not find '
+
csv_path
QMessageBox
.
information
(
self
,
"Information"
,
msg
)
return
continue
# read xlsx file, convert to HTML
# xd = pd.ExcelFile(csv_path)
# df = xd.parse()
# structure = df.to_html(index = False)
excel
=
xlrd
.
open_workbook
(
csv_path
)
sheet0
=
excel
.
sheet_by_index
(
0
)
# only sheet 0
merged_cells
=
sheet0
.
merged_cells
# (0,1,1,3) start row, end row, start col, end col
...
...
@@ -2384,7 +2371,6 @@ class MainWindow(QMainWindow):
token_list
=
convert_token
(
html_list
)
# load box annotations
cells
=
[]
for
anno
in
labeldict
[
image_path
]:
...
...
PPOCRLabel/libs/resources.py
View file @
0667daa3
This source diff could not be displayed because it is too large. You can
view the blob
instead.
PPOCRLabel/libs/utils.py
View file @
0667daa3
...
...
@@ -221,10 +221,10 @@ def convert_token(html_list):
token_list
.
append
(
"<td"
)
if
'colspan'
in
col
:
_
,
n
=
col
.
split
(
'colspan='
)
token_list
.
append
(
" colspan=
\"
{}
\"
"
.
format
(
n
))
token_list
.
append
(
" colspan=
\"
{}
\"
"
.
format
(
n
[
0
]
))
if
'rowspan'
in
col
:
_
,
n
=
col
.
split
(
'rowspan='
)
token_list
.
append
(
" rowspan=
\"
{}
\"
"
.
format
(
n
))
token_list
.
append
(
" rowspan=
\"
{}
\"
"
.
format
(
n
[
0
]
))
token_list
.
extend
([
">"
,
"</td>"
])
token_list
.
append
(
"</tr>"
)
token_list
.
append
(
"</tbody>"
)
...
...
PPOCRLabel/resources/strings/strings-en.properties
View file @
0667daa3
...
...
@@ -112,4 +112,4 @@ keyDialogTip=Enter object label
keyChange
=
Change Box Key
TableRecognition
=
Table Recognition
cellreRecognition
=
Cell Re-Recognition
exportJSON
=
e
xport
JSON
(PubTabNet)
exportJSON
=
E
xport
Excel Label
(PubTabNet)
PPOCRLabel/resources/strings/strings-zh-CN.properties
View file @
0667daa3
...
...
@@ -84,7 +84,7 @@ mhelp=帮助
iconList
=
缩略图
detectionBoxposition
=
检测框位置
recognitionResult
=
识别结果
creatPolygon
=
多
边形
标注
creatPolygon
=
多
点
标注
drawSquares
=
正方形标注
rotateLeft
=
图片左旋转90度
rotateRight
=
图片右旋转90度
...
...
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