From 3273a198dde8c63972a98d0fc075f84bd93108d5 Mon Sep 17 00:00:00 2001 From: dium6i <75460093+dium6i@users.noreply.github.com> Date: Thu, 1 Sep 2022 08:45:22 +0800 Subject: [PATCH] Update PPOCRLabel.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决了导出 JSON 文件时,L2534 将 "cells" 写成 "cell" 的问题。因如下代码取的是cells,否则在训练载入数据时会报 keyerror 的错误。 https://github.com/PaddlePaddle/PaddleOCR/blob/282eebbd660886c38d4ae91bcbcd70b5cdc03f75/ppocr/data/pubtab_dataset.py#L102 --- PPOCRLabel/PPOCRLabel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PPOCRLabel/PPOCRLabel.py b/PPOCRLabel/PPOCRLabel.py index c17db91a..d0d2bb72 100644 --- a/PPOCRLabel/PPOCRLabel.py +++ b/PPOCRLabel/PPOCRLabel.py @@ -2531,7 +2531,7 @@ class MainWindow(QMainWindow): split = 'test' # save dict - html = {'structure': {'tokens': token_list}, 'cell': cells} + html = {'structure': {'tokens': token_list}, 'cells': cells} json_results.append({'filename': os.path.basename(image_path), 'split': split, 'imgid': imgid, 'html': html}) imgid += 1 -- GitLab