提交 e41dfc6e 编写于 作者: qq_25193841's avatar qq_25193841

Update PPOCRLabel

Update PPOCRLabel
上级 ffd9e572
......@@ -2322,13 +2322,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:
......@@ -2351,14 +2344,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
......@@ -2370,7 +2357,6 @@ class MainWindow(QMainWindow):
token_list = convert_token(html_list)
# load box annotations
cells = []
for anno in labeldict[image_path]:
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -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>")
......
......@@ -112,4 +112,4 @@ keyDialogTip=Enter object label
keyChange=Change Box Key
TableRecognition=Table Recognition
cellreRecognition=Cell Re-Recognition
exportJSON=export JSON(PubTabNet)
exportJSON=Export Excel Label(PubTabNet)
......@@ -84,7 +84,7 @@ mhelp=帮助
iconList=缩略图
detectionBoxposition=检测框位置
recognitionResult=识别结果
creatPolygon=边形标注
creatPolygon=标注
drawSquares=正方形标注
rotateLeft=图片左旋转90度
rotateRight=图片右旋转90度
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册