未验证 提交 8c2ba6f8 编写于 作者: E Evezerest 提交者: GitHub

Merge pull request #6278 from Evezerest/release2.5

Update PPOCRLabel 
...@@ -2336,13 +2336,6 @@ class MainWindow(QMainWindow): ...@@ -2336,13 +2336,6 @@ class MainWindow(QMainWindow):
else: else:
labeldict[file] = [] 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() train_split, val_split, test_split = partitionDialog.getDataPartition()
# check validate # check validate
if train_split + val_split + test_split > 100: if train_split + val_split + test_split > 100:
...@@ -2365,14 +2358,8 @@ class MainWindow(QMainWindow): ...@@ -2365,14 +2358,8 @@ class MainWindow(QMainWindow):
filename, _ = os.path.splitext(os.path.basename(image_path)) filename, _ = os.path.splitext(os.path.basename(image_path))
csv_path = os.path.join(TableRec_excel_dir, filename + '.xlsx') csv_path = os.path.join(TableRec_excel_dir, filename + '.xlsx')
if not os.path.exists(csv_path): if not os.path.exists(csv_path):
msg = 'ERROR, Can not find ' + csv_path continue
QMessageBox.information(self, "Information", msg)
return
# 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) excel = xlrd.open_workbook(csv_path)
sheet0 = excel.sheet_by_index(0) # only sheet 0 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 merged_cells = sheet0.merged_cells # (0,1,1,3) start row, end row, start col, end col
...@@ -2384,7 +2371,6 @@ class MainWindow(QMainWindow): ...@@ -2384,7 +2371,6 @@ class MainWindow(QMainWindow):
token_list = convert_token(html_list) token_list = convert_token(html_list)
# load box annotations # load box annotations
cells = [] cells = []
for anno in labeldict[image_path]: for anno in labeldict[image_path]:
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
...@@ -221,10 +221,10 @@ def convert_token(html_list): ...@@ -221,10 +221,10 @@ def convert_token(html_list):
token_list.append("<td") token_list.append("<td")
if 'colspan' in col: if 'colspan' in col:
_, n = col.split('colspan=') _, n = col.split('colspan=')
token_list.append(" colspan=\"{}\"".format(n)) token_list.append(" colspan=\"{}\"".format(n[0]))
if 'rowspan' in col: if 'rowspan' in col:
_, n = col.split('rowspan=') _, n = col.split('rowspan=')
token_list.append(" rowspan=\"{}\"".format(n)) token_list.append(" rowspan=\"{}\"".format(n[0]))
token_list.extend([">", "</td>"]) token_list.extend([">", "</td>"])
token_list.append("</tr>") token_list.append("</tr>")
token_list.append("</tbody>") token_list.append("</tbody>")
......
...@@ -112,4 +112,4 @@ keyDialogTip=Enter object label ...@@ -112,4 +112,4 @@ keyDialogTip=Enter object label
keyChange=Change Box Key keyChange=Change Box Key
TableRecognition=Table Recognition TableRecognition=Table Recognition
cellreRecognition=Cell Re-Recognition cellreRecognition=Cell Re-Recognition
exportJSON=export JSON(PubTabNet) exportJSON=Export Excel Label(PubTabNet)
...@@ -84,7 +84,7 @@ mhelp=帮助 ...@@ -84,7 +84,7 @@ mhelp=帮助
iconList=缩略图 iconList=缩略图
detectionBoxposition=检测框位置 detectionBoxposition=检测框位置
recognitionResult=识别结果 recognitionResult=识别结果
creatPolygon=边形标注 creatPolygon=标注
drawSquares=正方形标注 drawSquares=正方形标注
rotateLeft=图片左旋转90度 rotateLeft=图片左旋转90度
rotateRight=图片右旋转90度 rotateRight=图片右旋转90度
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册