diff --git a/PPOCRLabel/PPOCRLabel.py b/PPOCRLabel/PPOCRLabel.py index 022e5aae47da8cdb22b6f5167dd75e05986e5b62..370eea15f22896e6f4eb72dbe9d4f5ab9218ac7f 100644 --- a/PPOCRLabel/PPOCRLabel.py +++ b/PPOCRLabel/PPOCRLabel.py @@ -2382,7 +2382,7 @@ class MainWindow(QMainWindow): # save dict html = {'structure': {'tokens': token_list}, 'cell': cells} - json_results.append({'filename': filename, 'split': split, 'imgid': imgid, 'html': html}) + json_results.append({'filename': os.path.basename(image_path), 'split': split, 'imgid': imgid, 'html': html}) imgid += 1 # save json diff --git a/PPOCRLabel/libs/utils.py b/PPOCRLabel/libs/utils.py index 86a0336d450f97ada673662ccad63e746fd27125..bf54700488e285da8a89b2648a17e0e1a7341b60 100644 --- a/PPOCRLabel/libs/utils.py +++ b/PPOCRLabel/libs/utils.py @@ -225,7 +225,7 @@ def convert_token(html_list): if 'rowspan' in col: _, n = col.split('rowspan=') token_list.append(" rowspan=\"{}\"".format(n)) - token_list.append(">") + token_list.extend([">", ""]) token_list.append("") token_list.append("")