mirror of
				https://github.com/PaddlePaddle/PaddleOCR.git
				synced 2025-11-04 03:39:22 +00:00 
			
		
		
		
	Update PPOCRLabel
Update PPOCRLabel
This commit is contained in:
		
							parent
							
								
									ffd9e57233
								
							
						
					
					
						commit
						e41dfc6e40
					
				@ -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]:
 | 
			
		||||
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -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度
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user