Skip to content

Commit 0529e23

Browse files
authored
docs: Add a new document site (#13375)
* docs: Add a new document site * docs: Update comment setting * chore(pre-commit): Remove rules of md and remove the size limits of 512kb * chore(format): Run pre-commit in local * ci(document): Change the default name of building document site. * chore: Update .pre-commit-config.yaml
1 parent 428832f commit 0529e23

File tree

615 files changed

+40222
-2
lines changed

Some content is hidden

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

615 files changed

+40222
-2
lines changed

.github/workflows/documents.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: build_document_site
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- main
7+
permissions:
8+
contents: write
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Configure Git Credentials
15+
run: |
16+
git config user.name github-actions[bot]
17+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: 3.x
21+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
22+
- uses: actions/cache@v4
23+
with:
24+
key: mkdocs-material-${{ env.cache_id }}
25+
path: .cache
26+
restore-keys: |
27+
mkdocs-material-
28+
- run: pip install mkdocs-material jieba mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-static-i18n
29+
- run: mkdocs gh-deploy --force

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ repos:
1010
- id: detect-private-key
1111
- id: end-of-file-fixer
1212
- id: trailing-whitespace
13-
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|py|md)$
13+
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|py)$
1414
- repo: https://github.com/Lucas-C/pre-commit-hooks
1515
rev: v1.5.1
1616
hooks:
1717
- id: remove-crlf
1818
- id: remove-tabs
19-
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|py|md)$
19+
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|py)$
2020
- repo: local
2121
hooks:
2222
- id: clang-format

docs/FAQ.en.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
comments: true
3+
hide:
4+
- navigation
5+
---
6+
7+
1. **Prediction error: got an unexpected keyword argument 'gradient_clip'**
8+
The installed version of paddle is incorrect. Currently, this project only supports Paddle 1.7, which will be adapted to 1.8 in the near future.
9+
10+
2. **Error when converting attention recognition model: KeyError: 'predict'**
11+
Solved. Please update to the latest version of the code.
12+
13+
3. **About inference speed**
14+
When there are many words in the picture, the prediction time will increase. You can use `--rec_batch_num` to set a smaller prediction batch num. The default value is 30, which can be changed to 10 or other values.
15+
16+
4. **Service deployment and mobile deployment**
17+
It is expected that the service deployment based on Serving and the mobile deployment based on Paddle Lite will be released successively in mid-to-late June. Stay tuned for more updates.
18+
19+
5. **Release time of self-developed algorithm**
20+
Baidu Self-developed algorithms such as SAST, SRN and end2end PSL will be released in June or July. Please be patient.
21+
22+
6. **How to run on Windows or Mac?**
23+
PaddleOCR has completed the adaptation to Windows and MAC systems. Two points should be noted during operation:
24+
1. In [Quick installation](./installation_en.md), if you do not want to install docker, you can skip the first step and start with the second step.
25+
2. When downloading the inference model, if wget is not installed, you can directly click the model link or copy the link address to the browser to download, then extract and place it in the corresponding directory.
26+
27+
7. **The difference between ultra-lightweight model and General OCR model**
28+
At present, PaddleOCR has opensourced two Chinese models, namely 8.6M ultra-lightweight Chinese model and general Chinese OCR model. The comparison information between the two is as follows:
29+
- Similarities: Both use the same **algorithm** and **training data**
30+
- Differences: The difference lies in **backbone network** and **channel parameters**, the ultra-lightweight model uses MobileNetV3 as the backbone network, the general model uses Resnet50_vd as the detection model backbone, and Resnet34_vd as the recognition model backbone. You can compare the two model training configuration files to see the differences in parameters.
31+
32+
|Model|Backbone|Detection configuration file|Recognition configuration file|
33+
|-|-|-|-|
34+
|8.6M ultra-lightweight Chinese OCR model|MobileNetV3+MobileNetV3|det_mv3_db.yml|rec_chinese_lite_train.yml|
35+
|General Chinese OCR model|Resnet50_vd+Resnet34_vd|det_r50_vd_db.yml|rec_chinese_common_train.yml|
36+
37+
8. **Is there a plan to opensource a model that only recognizes numbers or only English + numbers?**
38+
It is not planned to opensource numbers only, numbers + English only, or other vertical text models. PaddleOCR has opensourced a variety of detection and recognition algorithms for customized training. The two Chinese models are also based on the training output of the open-source algorithm library. You can prepare the data according to the tutorial, choose the appropriate configuration file, train yourselves, and we believe that you can get good result. If you have any questions during the training, you are welcome to open issues or ask in the communication group. We will answer them in time.
39+
40+
9. **What is the training data used by the open-source model? Can it be opensourced?**
41+
At present, the open source model, dataset and magnitude are as follows:
42+
- Detection:
43+
English dataset: ICDAR2015
44+
Chinese dataset: LSVT street view dataset with 3w pictures
45+
- Recognition:
46+
English dataset: MJSynth and SynthText synthetic dataset, the amount of data is tens of millions.
47+
Chinese dataset: LSVT street view dataset with cropped text area, a total of 30w images. In addition, the synthesized data based on LSVT corpus is 500w.
48+
49+
Among them, the public datasets are opensourced, users can search and download by themselves, or refer to [Chinese data set](dataset/datasets_en.md), synthetic data is not opensourced, users can use open-source synthesis tools to synthesize data themselves. Current available synthesis tools include [text_renderer](https://github.com/Sanster/text_renderer), [SynthText](https://github.com/ankush-me/SynthText), [TextRecognitionDataGenerator](https://github.com/Belval/TextRecognitionDataGenerator), etc.
50+
51+
10. **Error in using the model with TPS module for prediction**
52+
Error message: Input(X) dims[3] and Input(Grid) dims[2] should be equal, but received X dimension[3]\(108) != Grid dimension[2]\(100)
53+
Solution: TPS does not support variable shape. Please set --rec_image_shape='3,32,100' and --rec_char_type='en'
54+
55+
11. **Custom dictionary used during training, the recognition results show that words do not appear in the dictionary**
56+
The used custom dictionary path is not set when making prediction. The solution is setting parameter `rec_char_dict_path` to the corresponding dictionary file.
57+
58+
12. **Results of cpp_infer and python_inference are very different**
59+
Versions of exported inference model and inference library should be same. For example, on Windows platform, version of the inference library that PaddlePaddle provides is 1.8, but version of the inference model that PaddleOCR provides is 1.7, you should export model yourself(`tools/export_model.py`) on PaddlePaddle 1.8 and then use the exported model for inference.
60+
61+
13. **How to identify artistic fonts in signs or advertising images**
62+
Recognizing artistic fonts in signs or advertising images is a very challenging task because the variation in individual characters is much greater compared to standard fonts. If the artistic font to be identified is within a dictionary list, each word in the dictionary can be treated as a template for recognition using a general image retrieval system. You can try using PaddleClas image recognition system.

0 commit comments

Comments
 (0)