diff --git a/PPOCRLabel/PPOCRLabel.py b/PPOCRLabel/PPOCRLabel.py index 2287ba7d4cd62ac2c618b139e9ffb8c42196060e..450345fece5b7e2c093ef33c72dee7726816e8c1 100644 --- a/PPOCRLabel/PPOCRLabel.py +++ b/PPOCRLabel/PPOCRLabel.py @@ -431,8 +431,7 @@ class MainWindow(QMainWindow): # ================== New Actions ================== edit = action(getStr('editLabel'), self.editLabel, - 'Ctrl+E', 'edit', getStr('editLabelDetail'), - enabled=False) + 'Ctrl+E', 'edit', getStr('editLabelDetail'), enabled=False) AutoRec = action(getStr('autoRecognition'), self.autoRecognition, '', 'Auto', getStr('autoRecognition'), enabled=False) @@ -465,11 +464,10 @@ class MainWindow(QMainWindow): 'Ctrl+Z', "undo", getStr("undo"), enabled=False) change_cls = action(getStr("keyChange"), self.change_box_key, - 'Ctrl+B', "edit", getStr("keyChange"), enabled=False) + 'Ctrl+X', "edit", getStr("keyChange"), enabled=False) lock = action(getStr("lockBox"), self.lockSelectedShape, - None, "lock", getStr("lockBoxDetail"), - enabled=False) + None, "lock", getStr("lockBoxDetail"), enabled=False) self.editButton.setDefaultAction(edit) self.newButton.setDefaultAction(create) @@ -534,7 +532,8 @@ class MainWindow(QMainWindow): fileMenuActions=(opendir, open_dataset_dir, saveLabel, resetAll, quit), beginner=(), advanced=(), editMenu=(createpoly, edit, copy, delete, singleRere, None, undo, undoLastPoint, - None, rotateLeft, rotateRight, None, color1, self.drawSquaresOption, lock), + None, rotateLeft, rotateRight, None, color1, self.drawSquaresOption, lock, + None, change_cls), beginnerContext=( create, edit, copy, delete, singleRere, rotateLeft, rotateRight, lock, change_cls), advancedContext=(createMode, editMode, edit, copy, @@ -2206,6 +2205,8 @@ class MainWindow(QMainWindow): print('The program will automatically save once after confirming 5 images (default)') def change_box_key(self): + if not self.kie_mode: + return key_text, _ = self.keyDialog.popUp(self.key_previous_text) if key_text is None: return @@ -2219,6 +2220,7 @@ class MainWindow(QMainWindow): self.keyList.setItemLabel(item, key_text, rgb) self._update_shape_color(shape) + self.keyDialog.addLabelHistory(key_text) def undoShapeEdit(self): self.canvas.restoreShape() diff --git a/PPOCRLabel/README.md b/PPOCRLabel/README.md index 4d25e670ae6d07d569a247bc5f9c35c939b23f8e..4cb32234d0363a6c7631220bb703bf657f16d250 100644 --- a/PPOCRLabel/README.md +++ b/PPOCRLabel/README.md @@ -156,6 +156,7 @@ python PPOCRLabel.py --kie True # [KIE mode] for [detection + recognition + keyw | X | Rotate the box anti-clockwise | | C | Rotate the box clockwise | | Ctrl + E | Edit label of the selected box | +| Ctrl + X | Change key class of the box when enable `--kie` | | Ctrl + R | Re-recognize the selected box | | Ctrl + C | Copy and paste the selected box | | Ctrl + Left Mouse Button | Multi select the label box | diff --git a/PPOCRLabel/README_ch.md b/PPOCRLabel/README_ch.md index 3f8dc4f0c6b7cc88a71409d123f598e74b3f2cad..1417892e4ee7eeba069d9924c493ebfea656d026 100644 --- a/PPOCRLabel/README_ch.md +++ b/PPOCRLabel/README_ch.md @@ -137,25 +137,26 @@ python PPOCRLabel.py --lang ch --kie True # 启动 【KIE 模式】,用于打 ### 3.1 快捷键 -| 快捷键 | 说明 | -|------------------|----------------| -| Ctrl + shift + R | 对当前图片的所有标记重新识别 | -| W | 新建矩形框 | -| Q | 新建四点框 | -| X | 框逆时针旋转 | -| C | 框顺时针旋转 | -| Ctrl + E | 编辑所选框标签 | -| Ctrl + R | 重新识别所选标记 | -| Ctrl + C | 复制并粘贴选中的标记框 | -| Ctrl + 鼠标左键 | 多选标记框 | -| Alt + X | 删除所选框 | -| Ctrl + V | 确认本张图片标记 | -| Ctrl + Shift + d | 删除本张图片 | -| D | 下一张图片 | -| A | 上一张图片 | -| Ctrl++ | 缩小 | -| Ctrl-- | 放大 | -| ↑→↓← | 移动标记框 | +| 快捷键 | 说明 | +|------------------|---------------------------------| +| Ctrl + shift + R | 对当前图片的所有标记重新识别 | +| W | 新建矩形框 | +| Q | 新建四点框 | +| X | 框逆时针旋转 | +| C | 框顺时针旋转 | +| Ctrl + E | 编辑所选框标签 | +| Ctrl + X | `--kie` 模式下,修改 Box 的关键字种类 | +| Ctrl + R | 重新识别所选标记 | +| Ctrl + C | 复制并粘贴选中的标记框 | +| Ctrl + 鼠标左键 | 多选标记框 | +| Alt + X | 删除所选框 | +| Ctrl + V | 确认本张图片标记 | +| Ctrl + Shift + d | 删除本张图片 | +| D | 下一张图片 | +| A | 上一张图片 | +| Ctrl++ | 缩小 | +| Ctrl-- | 放大 | +| ↑→↓← | 移动标记框 | ### 3.2 内置模型