diff --git a/PPOCRLabel/PPOCRLabel.py b/PPOCRLabel/PPOCRLabel.py index b4c73083..15b0b0b5 100644 --- a/PPOCRLabel/PPOCRLabel.py +++ b/PPOCRLabel/PPOCRLabel.py @@ -147,7 +147,7 @@ class MainWindow(QMainWindow, WindowMixin): self.prevLabelText = getStr('tempLabel') self.model = 'paddle' self.PPreader = None - self.autoSaveNum = 10 + self.autoSaveNum = 5 ################# file list ############### self.fileListWidget = QListWidget() diff --git a/PPOCRLabel/README.md b/PPOCRLabel/README.md index b7a359d4..fda8725b 100644 --- a/PPOCRLabel/README.md +++ b/PPOCRLabel/README.md @@ -76,7 +76,7 @@ python3 PPOCRLabel.py 9. Click "Delete Image" and the image will be deleted to the recycle bin. -10. Labeling result: the user can save manually through the menu "File - Save Label", while the program will also save automatically after every 10 images confirmed by the user.the manually checked label will be stored in *Label.txt* under the opened picture folder. +10. Labeling result: the user can save manually through the menu "File - Save Label", while the program will also save automatically after every 5 images confirmed by the user.the manually checked label will be stored in *Label.txt* under the opened picture folder. Click "PaddleOCR"-"Save Recognition Results" in the menu bar, the recognition training data of such pictures will be saved in the *crop_img* folder, and the recognition label will be saved in *rec_gt.txt*[4]. ### Note @@ -92,7 +92,7 @@ Therefore, if the recognition result has been manually changed before, it may ch | File name | Description | | :-----------: | :----------------------------------------------------------: | -| Label.txt | The detection label file can be directly used for PPOCR detection model training. After the user saves 10 label results, the file will be automatically saved. It will also be written when the user closes the application or changes the file folder. | +| Label.txt | The detection label file can be directly used for PPOCR detection model training. After the user saves 5 label results, the file will be automatically saved. It will also be written when the user closes the application or changes the file folder. | | fileState.txt | The picture status file save the image in the current folder that has been manually confirmed by the user. | | Cache.cach | Cache files to save the results of model recognition. | | rec_gt.txt | The recognition label file, which can be directly used for PPOCR identification model training, is generated after the user clicks on the menu bar "File"-"Save recognition result". | @@ -128,6 +128,15 @@ Therefore, if the recognition result has been manually changed before, it may ch - Custom model: The model trained by users can be replaced by modifying PPOCRLabel.py in [PaddleOCR class instantiation](https://github.com/PaddlePaddle/PaddleOCR/blob/develop/PPOCRLabel/PPOCRLabel.py#L110) referring [Custom Model Code](https://github.com/PaddlePaddle/PaddleOCR/blob/develop/doc/doc_en/whl_en.md#use-custom-model) +### Save + +PPOCRLabel supports three ways to save Label.txt + +- Automatically save: When it detects that the user has manually checked 5 pictures, the program automatically writes the annotations into Label.txt. The user can change the value of ``self.autoSaveNum`` in ``PPOCRLabel.py`` to set the number of images to be automatically saved after confirmation. +- Manual save: Click "File-Save Marking Results" to manually save the label. +- Close application save + + ### Export partial recognition results For some data that are difficult to recognize, the recognition results will not be exported by **unchecking** the corresponding tags in the recognition results checkbox. diff --git a/PPOCRLabel/README_ch.md b/PPOCRLabel/README_ch.md index 4200a214..397df676 100644 --- a/PPOCRLabel/README_ch.md +++ b/PPOCRLabel/README_ch.md @@ -63,7 +63,7 @@ python3 PPOCRLabel.py --lang ch 7. 内容更改:双击识别结果,对不准确的识别结果进行手动更改。 8. 确认标记:点击 “确认”,图片状态切换为 “√”,跳转至下一张(此时不会直接将结果写入文件)。 9. 删除:点击 “删除图像”,图片将会被删除至回收站。 -10. 保存结果:用户可以通过菜单中“文件-保存标记结果”手动保存,同时程序也会在用户每确认10张图片后自动保存一次。手动确认过的标记将会被存放在所打开图片文件夹下的*Label.txt*中。在菜单栏点击 “文件” - "保存识别结果"后,会将此类图片的识别训练数据保存在*crop_img*文件夹下,识别标签保存在*rec_gt.txt*中[4]。 +10. 保存结果:用户可以通过菜单中“文件-保存标记结果”手动保存,同时程序也会在用户每确认5张图片后自动保存一次。手动确认过的标记将会被存放在所打开图片文件夹下的*Label.txt*中。在菜单栏点击 “文件” - "保存识别结果"后,会将此类图片的识别训练数据保存在*crop_img*文件夹下,识别标签保存在*rec_gt.txt*中[4]。 ### 注意 @@ -77,7 +77,7 @@ python3 PPOCRLabel.py --lang ch | 文件名 | 说明 | | :-----------: | :----------------------------------------------------------: | -| Label.txt | 检测标签,可直接用于PPOCR检测模型训练。用户每保存10张检测结果后,程序会进行自动写入。当用户关闭应用程序或切换文件路径后同样会进行写入。 | +| Label.txt | 检测标签,可直接用于PPOCR检测模型训练。用户每保存5张检测结果后,程序会进行自动写入。当用户关闭应用程序或切换文件路径后同样会进行写入。 | | fileState.txt | 图片状态标记文件,保存当前文件夹下已经被用户手动确认过的图片名称。 | | Cache.cach | 缓存文件,保存模型自动识别的结果。 | | rec_gt.txt | 识别标签。可直接用于PPOCR识别模型训练。需用户手动点击菜单栏“文件” - "保存识别结果"后产生。 | @@ -112,6 +112,14 @@ python3 PPOCRLabel.py --lang ch - 自定义模型:用户可根据[自定义模型代码使用](https://github.com/PaddlePaddle/PaddleOCR/blob/develop/doc/doc_ch/whl.md#%E8%87%AA%E5%AE%9A%E4%B9%89%E6%A8%A1%E5%9E%8B),通过修改PPOCRLabel.py中针对[PaddleOCR类的实例化](https://github.com/PaddlePaddle/PaddleOCR/blob/develop/PPOCRLabel/PPOCRLabel.py#L110)替换成自己训练的模型。 +### 保存方式 + +PPOCRLabel支持三种保存方式: + +- 程序自动保存:当检测到用户手动确认过5张图片后,程序自动将标记结果写入Label.txt中。其中用户可通过更改```PPOCRLabel.py```中的```self.autoSaveNum```的数值设置确认几张图片后进行自动保存。 +- 手动保存:点击“文件 - 保存标记结果”手动保存标记。 +- 关闭应用程序保存 + ### 导出部分识别结果 针对部分难以识别的数据,通过在识别结果的复选框中**取消勾选**相应的标记,其识别结果不会被导出。 diff --git a/PPOCRLabel/requirements/requirements-linux-python3.txt b/PPOCRLabel/requirements/requirements-linux-python3.txt deleted file mode 100644 index 787a7fda..00000000 --- a/PPOCRLabel/requirements/requirements-linux-python3.txt +++ /dev/null @@ -1,2 +0,0 @@ -pyqt5==5.10.1 -lxml==4.2.4