From b657a3a684b82d0356e6dc51111fc688a32c40ea Mon Sep 17 00:00:00 2001 From: Leif <4603009@qq.com> Date: Fri, 6 May 2022 11:49:06 +0800 Subject: [PATCH] change label filename change label filename --- PPOCRLabel/PPOCRLabel.py | 2 +- PPOCRLabel/libs/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PPOCRLabel/PPOCRLabel.py b/PPOCRLabel/PPOCRLabel.py index f80cf8fd..5839ec19 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 86a0336d..bf547004 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("") -- GitLab