Skip to content

Commit

Permalink
add auto Re-recognition switch option (#71)
Browse files Browse the repository at this point in the history
* add auto Re-recognition switch option

* reformat

* fix code style
  • Loading branch information
yes-github committed Sep 11, 2024
1 parent 6bf1080 commit f3ab29a
Show file tree
Hide file tree
Showing 4 changed files with 11,749 additions and 11,746 deletions.
11 changes: 11 additions & 0 deletions PPOCRLabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,14 @@ def getStr(strId):
self.displayIndexOption.setChecked(settings.get(SETTING_PAINT_INDEX, False))
self.autoSaveOption.triggered.connect(self.autoSaveFunc)

self.autoReRecognitionOption = QAction(getStr("autoReRecognition"), self)
self.autoReRecognitionOption.setCheckable(True)
self.autoReRecognitionOption.setChecked(
settings.get(SETTING_PAINT_LABEL, False)
)
self.displayIndexOption.setChecked(settings.get(SETTING_PAINT_INDEX, False))
self.autoReRecognitionOption.triggered.connect(self.autoSaveFunc)

addActions(
self.menus.file,
(
Expand All @@ -1038,6 +1046,7 @@ def getStr(strId):
saveRec,
exportJSON,
self.autoSaveOption,
self.autoReRecognitionOption,
None,
resetAll,
deleteImg,
Expand Down Expand Up @@ -1863,6 +1872,8 @@ def newShape(self, value=True):
self.actions.editMode.setEnabled(True)
self.setDirty()

if self.autoReRecognitionOption.isChecked():
self.reRecognition()
else:
# self.canvas.undoLastLine()
self.canvas.resetAllLines()
Expand Down
Loading

0 comments on commit f3ab29a

Please sign in to comment.