diff --git a/PPOCRLabel/PPOCRLabel.py b/PPOCRLabel/PPOCRLabel.py index 523661b635ed4eaaf8d2b4ac05aaf60b2abc8541..7c7802a73ed32680142f8119b10a0393d1fab9cc 100644 --- a/PPOCRLabel/PPOCRLabel.py +++ b/PPOCRLabel/PPOCRLabel.py @@ -1439,8 +1439,8 @@ class MainWindow(QMainWindow): DEFAULT_LOCK_COLOR, key_cls, box['difficult'])) if imgidx in self.PPlabel.keys(): for box in self.PPlabel[imgidx]: - key_cls = None if not self.kie_mode else box['key_cls'] - shapes.append((box['transcription'], box['points'], None, key_cls, box['difficult'])) + key_cls = None if not self.kie_mode else box.get('key_cls', 'None') + shapes.append((box['transcription'], box['points'], None, key_cls, box.get('difficult', False))) self.loadLabels(shapes) self.canvas.verified = False @@ -1584,7 +1584,7 @@ class MainWindow(QMainWindow): for image, info in label_dict.items(): for box in info: if "key_cls" not in box: - continue + box.update({"key_cls": "None"}) self.existed_key_cls_set.add(box["key_cls"]) if len(self.existed_key_cls_set) > 0: for key_text in self.existed_key_cls_set: @@ -1606,8 +1606,6 @@ class MainWindow(QMainWindow): fit_to_content={'column': True, 'row': False}, flags=None ) - else: - self.keyDialog.labelList.addItems(self.existed_key_cls_set) def importDirImages(self, dirpath, isDelete=False): if not self.mayContinue() or not dirpath: diff --git a/PPOCRLabel/README.md b/PPOCRLabel/README.md index 0a1a7536912b6591517050bfa62260aaef6077cd..95baf66b297bb17b9396a20b8aa156fbd8273e39 100644 --- a/PPOCRLabel/README.md +++ b/PPOCRLabel/README.md @@ -12,6 +12,7 @@ PPOCRLabel is a semi-automatic graphic annotation tool suitable for OCR field, w - Add KIE Mode by using `--kie`, for [detection + identification + keyword extraction] labeling. - 2022.01:(by [PeterH0323](https://github.com/peterh0323) ) - Improve user experience: prompt for the number of files and labels, optimize interaction, and fix bugs such as only use CPU when inference + - New functions: Support using `C` or `X` to rotate box. - 2021.11.17: - Support install and start PPOCRLabel through the whl package (by [d2623587501](https://github.com/d2623587501)) - Dataset segmentation: Divide the annotation file into training, verification and testing parts (refer to section 3.5 below, by [MrCuiHao](https://github.com/MrCuiHao)) diff --git a/PPOCRLabel/README_ch.md b/PPOCRLabel/README_ch.md index 99c088de83f9cba775733a0473b50596683c47ab..5534b308f3b49905bfaa33b24e128e2bbcc1ef5b 100644 --- a/PPOCRLabel/README_ch.md +++ b/PPOCRLabel/README_ch.md @@ -11,7 +11,8 @@ PPOCRLabel是一款适用于OCR领域的半自动化图形标注工具,内置P - 2022.02:(by [PeterH0323](https://github.com/peterh0323) ) - 新增:使用 `--kie` 进入 KIE 功能,用于打【检测+识别+关键字提取】的标签 - 2022.01:(by [PeterH0323](https://github.com/peterh0323) ) - - 提升用户体验:新增文件与标记数目提示、优化交互、修复gpu使用等问题 + - 提升用户体验:新增文件与标记数目提示、优化交互、修复gpu使用等问题。 + - 新增功能:使用 `C` 和 `X` 对标记框进行旋转。 - 2021.11.17: - 新增支持通过whl包安装和启动PPOCRLabel(by [d2623587501](https://github.com/d2623587501)) - 标注数据集切分:对标注数据进行训练、验证与测试集划分(参考下方3.5节,by [MrCuiHao](https://github.com/MrCuiHao))