Skip to content

Commit f05759a

Browse files
committed
update common pre-commit configs and commit the results of running pre-commit run -a
1 parent 6e7a1b8 commit f05759a

File tree

348 files changed

+2971
-2965
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

348 files changed

+2971
-2965
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ paddleocr.egg-info/
3131
/deploy/android_demo/app/.cxx/
3232
/deploy/android_demo/app/cache/
3333
test_tipc/web/models/
34-
test_tipc/web/node_modules/
34+
test_tipc/web/node_modules/

.pre-commit-config.yaml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: a11d9314b22d8f8c7556443875b731ef05965464
3+
rev: v4.6.0
44
hooks:
5+
- id: check-added-large-files
6+
args: ['--maxkb=512']
7+
- id: check-case-conflict
58
- id: check-merge-conflict
69
- id: check-symlinks
710
- id: detect-private-key
8-
files: (?!.*paddle)^.*$
911
- id: end-of-file-fixer
10-
files: \.md$
1112
- id: trailing-whitespace
12-
files: \.md$
13+
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|py|md)$
1314
- repo: https://github.com/Lucas-C/pre-commit-hooks
14-
rev: v1.0.1
15+
rev: v1.5.1
1516
hooks:
16-
- id: forbid-crlf
17-
files: \.md$
1817
- id: remove-crlf
19-
files: \.md$
20-
- id: forbid-tabs
21-
files: \.md$
2218
- id: remove-tabs
23-
files: \.md$
19+
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|py|md)$
2420
- repo: local
2521
hooks:
2622
- id: clang-format
@@ -31,7 +27,7 @@ repos:
3127
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|cuh|proto)$
3228
# For Python files
3329
- repo: https://github.com/psf/black.git
34-
rev: 23.3.0
30+
rev: 24.4.2
3531
hooks:
3632
- id: black
3733
files: (.*\.(py|pyi|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
@@ -47,4 +43,3 @@ repos:
4743
- --show-source
4844
- --statistics
4945
exclude: ^benchmark/|^test_tipc/
50-

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ recursive-include ppocr/postprocess *.py
77
recursive-include tools/infer *.py
88
recursive-include tools __init__.py
99
recursive-include ppocr/utils/e2e_utils *.py
10-
recursive-include ppstructure *.py
10+
recursive-include ppstructure *.py

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ PaddleOCR is being oversight by a [PMC](https://github.com/PaddlePaddle/PaddleOC
207207
<details open>
208208
<summary>PP-Structure 文档分析</summary>
209209

210-
- 版面分析+表格识别
210+
- 版面分析+表格识别
211211
<div align="center">
212212
<img src="./ppstructure/docs/table/ppstructure.GIF" width="800">
213213
</div>
214214

215-
- SER(语义实体识别)
215+
- SER(语义实体识别)
216216
<div align="center">
217217
<img src="https://user-images.githubusercontent.com/14270174/185310636-6ce02f7c-790d-479f-b163-ea97a5a04808.jpg" width="600">
218218
</div>

README_en.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ PaddleOCR support a variety of cutting-edge algorithms related to OCR, and devel
119119
- [Mobile](./deploy/lite/readme.md)
120120
- [Paddle2ONNX](./deploy/paddle2onnx/readme.md)
121121
- [PaddleCloud](./deploy/paddlecloud/README.md)
122-
- [Benchmark](./doc/doc_en/benchmark_en.md)
122+
- [Benchmark](./doc/doc_en/benchmark_en.md)
123123
- [PP-Structure 🔥](./ppstructure/README.md)
124124
- [Quick Start](./ppstructure/docs/quickstart_en.md)
125125
- [Model Zoo](./ppstructure/docs/models_list_en.md)
126-
- [Model training](./doc/doc_en/training_en.md)
126+
- [Model training](./doc/doc_en/training_en.md)
127127
- [Layout Analysis](./ppstructure/layout/README.md)
128128
- [Table Recognition](./ppstructure/table/README.md)
129129
- [Key Information Extraction](./ppstructure/kie/README.md)
@@ -136,7 +136,7 @@ PaddleOCR support a variety of cutting-edge algorithms related to OCR, and devel
136136
- [Text recognition](./doc/doc_en/algorithm_overview_en.md)
137137
- [End-to-end OCR](./doc/doc_en/algorithm_overview_en.md)
138138
- [Table Recognition](./doc/doc_en/algorithm_overview_en.md)
139-
- [Key Information Extraction](./doc/doc_en/algorithm_overview_en.md)
139+
- [Key Information Extraction](./doc/doc_en/algorithm_overview_en.md)
140140
- [Add New Algorithms to PaddleOCR](./doc/doc_en/add_new_algorithm_en.md)
141141
- Data Annotation and Synthesis
142142
- [Semi-automatic Annotation Tool: PPOCRLabel](https://github.com/PFCCLab/PPOCRLabel/blob/main/README.md)
@@ -188,7 +188,7 @@ PaddleOCR support a variety of cutting-edge algorithms related to OCR, and devel
188188
<details open>
189189
<summary>PP-StructureV2</summary>
190190

191-
- layout analysis + table recognition
191+
- layout analysis + table recognition
192192
<div align="center">
193193
<img src="./ppstructure/docs/table/ppstructure.GIF" width="800">
194194
</div>
@@ -209,7 +209,7 @@ PaddleOCR support a variety of cutting-edge algorithms related to OCR, and devel
209209
- RE (Relation Extraction)
210210
<div align="center">
211211
<img src="https://user-images.githubusercontent.com/25809855/186094813-3a8e16cc-42e5-4982-b9f4-0134dfb5688d.png" width="600">
212-
</div>
212+
</div>
213213

214214
<div align="center">
215215
<img src="https://user-images.githubusercontent.com/14270174/185393805-c67ff571-cf7e-4217-a4b0-8b396c4f22bb.jpg" width="600">

applications/PCB字符识别/PCB字符识别.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ python3 tools/infer/predict_system.py \
546546
--use_gpu=True
547547
```
548548

549-
得到保存结果,文本检测识别可视化图保存在`det_rec_infer/`目录下,预测结果保存在`det_rec_infer/system_results.txt`中,格式如下:`0018.jpg [{"transcription": "E295", "points": [[88, 33], [137, 33], [137, 40], [88, 40]]}]`
549+
得到保存结果,文本检测识别可视化图保存在`det_rec_infer/`目录下,预测结果保存在`det_rec_infer/system_results.txt`中,格式如下:`0018.jpg [{"transcription": "E295", "points": [[88, 33], [137, 33], [137, 40], [88, 40]]}]`
550550

551551
2)然后将步骤一保存的数据转换为端对端评测需要的数据格式: 修改 `tools/end2end/convert_ppocr_label.py`中的代码,convert_label函数中设置输入标签路径,Mode,保存标签路径等,对预测数据的GTlabel和预测结果的label格式进行转换。
552552
```

applications/PCB字符识别/gen_data/corpus/text.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ K06
2727
KIEY
2828
NZQJ
2929
UN1B
30-
6X4
30+
6X4

applications/中文表格识别.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ display(HTML('<html><body><table><tr><td colspan="5">alleadersh</td><td rowspan=
456456

457457
预测结果如下:
458458
```
459-
val_9.jpg: {'attributes': ['Scanned', 'Little', 'Black-and-White', 'Clear', 'Without-Obstacles', 'Horizontal'], 'output': [1, 1, 1, 1, 1, 1]}
459+
val_9.jpg: {'attributes': ['Scanned', 'Little', 'Black-and-White', 'Clear', 'Without-Obstacles', 'Horizontal'], 'output': [1, 1, 1, 1, 1, 1]}
460460
```
461461

462462

@@ -466,7 +466,7 @@ val_9.jpg: {'attributes': ['Scanned', 'Little', 'Black-and-White', 'Clear', 'Wi
466466

467467
预测结果如下:
468468
```
469-
val_3253.jpg: {'attributes': ['Photo', 'Little', 'Black-and-White', 'Blurry', 'Without-Obstacles', 'Tilted'], 'output': [0, 1, 1, 0, 1, 0]}
469+
val_3253.jpg: {'attributes': ['Photo', 'Little', 'Black-and-White', 'Blurry', 'Without-Obstacles', 'Tilted'], 'output': [0, 1, 1, 0, 1, 0]}
470470
```
471471

472472
对比两张图片可以发现,第一张图片比较清晰,表格属性的结果也偏向于比较容易识别,我们可以更相信表格识别的结果,第二张图片比较模糊,且存在倾斜现象,表格识别可能存在错误,需要我们人工进一步校验。通过表格的属性识别能力,可以进一步将“人工”和“智能”很好的结合起来,为表格识别能力的落地的精度提供保障。

applications/光功率计数码管字符识别/光功率计数码管字符识别.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -434,16 +434,16 @@ python3 -m paddle.distributed.launch --gpus '0' tools/eval.py -c configs/rec/PP-
434434

435435
```
436436
output/rec/
437-
├── best_accuracy.pdopt
438-
├── best_accuracy.pdparams
439-
├── best_accuracy.states
440-
├── config.yml
441-
├── iter_epoch_3.pdopt
442-
├── iter_epoch_3.pdparams
443-
├── iter_epoch_3.states
444-
├── latest.pdopt
445-
├── latest.pdparams
446-
├── latest.states
437+
├── best_accuracy.pdopt
438+
├── best_accuracy.pdparams
439+
├── best_accuracy.states
440+
├── config.yml
441+
├── iter_epoch_3.pdopt
442+
├── iter_epoch_3.pdparams
443+
├── iter_epoch_3.states
444+
├── latest.pdopt
445+
├── latest.pdparams
446+
├── latest.states
447447
└── train.log
448448
```
449449

applications/包装生产日期识别.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def get_cropus(f):
243243
elif 0.7 < rad < 0.8:
244244
f.write('20{:02d}-{:02d}-{:02d}'.format(year, month, day))
245245
elif 0.8 < rad < 0.9:
246-
f.write('20{:02d}.{:02d}.{:02d}'.format(year, month, day))
246+
f.write('20{:02d}.{:02d}.{:02d}'.format(year, month, day))
247247
else:
248248
f.write('{:02d}:{:02d}:{:02d} {:02d}'.format(hours, minute, second, file_id2))
249249

0 commit comments

Comments
 (0)