chore: import upstream snapshot with attribution
Build/Publish Develop Docs / deploy (push) Failing after 1s
PaddleOCR Code Style Check / check-code-style (push) Failing after 1s
PaddleOCR PR Tests GPU / detect-changes (push) Failing after 1s
PaddleOCR PR Tests / detect-changes (push) Failing after 1s
PaddleOCR PR Tests GPU / test-pr-gpu (push) Has been cancelled
PaddleOCR PR Tests / test-pr (push) Has been cancelled
PaddleOCR PR Tests GPU / test-pr-gpu-impl (push) Has been cancelled
PaddleOCR PR Tests / test-pr-python (3.13) (push) Has been cancelled
PaddleOCR PR Tests / test-pr-python (3.8) (push) Has been cancelled
PaddleOCR PR Tests / test-pr-python (3.9) (push) Has been cancelled
Build/Publish Develop Docs / deploy (push) Failing after 1s
PaddleOCR Code Style Check / check-code-style (push) Failing after 1s
PaddleOCR PR Tests GPU / detect-changes (push) Failing after 1s
PaddleOCR PR Tests / detect-changes (push) Failing after 1s
PaddleOCR PR Tests GPU / test-pr-gpu (push) Has been cancelled
PaddleOCR PR Tests / test-pr (push) Has been cancelled
PaddleOCR PR Tests GPU / test-pr-gpu-impl (push) Has been cancelled
PaddleOCR PR Tests / test-pr-python (3.13) (push) Has been cancelled
PaddleOCR PR Tests / test-pr-python (3.8) (push) Has been cancelled
PaddleOCR PR Tests / test-pr-python (3.9) (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
---
|
||||
comments: true
|
||||
---
|
||||
|
||||
# Text Gestalt
|
||||
|
||||
## 1. Introduction
|
||||
|
||||
Paper:
|
||||
> [Text Gestalt: Stroke-Aware Scene Text Image Super-Resolution](https://arxiv.org/pdf/2112.08171.pdf)
|
||||
> Chen, Jingye and Yu, Haiyang and Ma, Jianqi and Li, Bin and Xue, Xiangyang
|
||||
> AAAI, 2022
|
||||
|
||||
Referring to the [FudanOCR](https://github.com/FudanVI/FudanOCR/tree/main/text-gestalt) data download instructions, the effect of the super-score algorithm on the TextZoom test set is as follows:
|
||||
|
||||
|Model | Backbone|config|Acc|Download link|
|
||||
|---|---|---|---|---|
|
||||
|Text Gestalt|tsrn|19.28|0.6560| [configs/sr/sr_tsrn_transformer_strock.yml](https://github.com/PaddlePaddle/PaddleOCR/tree/{{PADDLEOCR_GITHUB_REF}}/configs/sr/sr_tsrn_transformer_strock.yml)|[train model](https://paddleocr.bj.bcebos.com/sr_tsrn_transformer_strock_train.tar)|
|
||||
|
||||
## 2. Environment
|
||||
|
||||
Please refer to ["Environment Preparation"](../../ppocr/environment.en.md) to configure the PaddleOCR environment, and refer to ["Project Clone"](../../ppocr/blog/clone.en.md)to clone the project code.
|
||||
|
||||
## 3. Model Training / Evaluation / Prediction
|
||||
|
||||
Please refer to [Text Recognition Tutorial](../../ppocr/model_train/recognition.en.md). PaddleOCR modularizes the code, and training different models only requires **changing the configuration file**.
|
||||
|
||||
### Training
|
||||
|
||||
Specifically, after the data preparation is completed, the training can be started. The training command is as follows:
|
||||
|
||||
```bash linenums="1"
|
||||
# Single GPU training (long training period, not recommended)
|
||||
python3 tools/train.py -c configs/sr/sr_tsrn_transformer_strock.yml
|
||||
|
||||
# Multi GPU training, specify the gpu number through the --gpus parameter
|
||||
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/sr/sr_tsrn_transformer_strock.yml
|
||||
```
|
||||
|
||||
### Evaluation
|
||||
|
||||
```bash linenums="1"
|
||||
# GPU evaluation
|
||||
python3 -m paddle.distributed.launch --gpus '0' tools/eval.py -c configs/sr/sr_tsrn_transformer_strock.yml -o Global.pretrained_model={path/to/weights}/best_accuracy
|
||||
```
|
||||
|
||||
### Prediction
|
||||
|
||||
```bash linenums="1"
|
||||
# The configuration file used for prediction must match the training
|
||||
|
||||
python3 tools/infer_sr.py -c configs/sr/sr_tsrn_transformer_strock.yml -o Global.pretrained_model={path/to/weights}/best_accuracy Global.infer_img=doc/imgs_words_en/word_52.png
|
||||
```
|
||||
|
||||

|
||||
|
||||
After executing the command, the super-resolution result of the above image is as follows:
|
||||
|
||||

|
||||
|
||||
## 4. Inference and Deployment
|
||||
|
||||
### 4.1 Python Inference
|
||||
|
||||
First, the model saved during the training process is converted into an inference model. ( [Model download link](https://paddleocr.bj.bcebos.com/sr_tsrn_transformer_strock_train.tar) ), you can use the following command to convert:
|
||||
|
||||
```bash linenums="1"
|
||||
python3 tools/export_model.py -c configs/sr/sr_tsrn_transformer_strock.yml -o Global.pretrained_model={path/to/weights}/best_accuracy Global.save_inference_dir=./inference/sr_out
|
||||
```
|
||||
|
||||
For Text-Gestalt super-resolution model inference, the following commands can be executed:
|
||||
|
||||
```bash linenums="1"
|
||||
python3 tools/infer/predict_sr.py --sr_model_dir=./inference/sr_out --image_dir=doc/imgs_words_en/word_52.png --sr_image_shape=3,32,128
|
||||
```
|
||||
|
||||
After executing the command, the super-resolution result of the above image is as follows:
|
||||
|
||||

|
||||
|
||||
### 4.2 C++ Inference
|
||||
|
||||
Not supported
|
||||
|
||||
### 4.3 Serving
|
||||
|
||||
Not supported
|
||||
|
||||
### 4.4 More
|
||||
|
||||
Not supported
|
||||
|
||||
## 5. FAQ
|
||||
|
||||
## Citation
|
||||
|
||||
```bibtex
|
||||
@inproceedings{chen2022text,
|
||||
title={Text gestalt: Stroke-aware scene text image super-resolution},
|
||||
author={Chen, Jingye and Yu, Haiyang and Ma, Jianqi and Li, Bin and Xue, Xiangyang},
|
||||
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
|
||||
volume={36},
|
||||
number={1},
|
||||
pages={285--293},
|
||||
year={2022}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,107 @@
|
||||
---
|
||||
typora-copy-images-to: images
|
||||
comments: true
|
||||
---
|
||||
|
||||
# Text Gestalt
|
||||
|
||||
## 1. 算法简介
|
||||
|
||||
论文信息:
|
||||
> [Text Gestalt: Stroke-Aware Scene Text Image Super-Resolution](https://arxiv.org/pdf/2112.08171.pdf)
|
||||
> Chen, Jingye and Yu, Haiyang and Ma, Jianqi and Li, Bin and Xue, Xiangyang
|
||||
> AAAI, 2022
|
||||
|
||||
参考[FudanOCR](https://github.com/FudanVI/FudanOCR/tree/main/text-gestalt) 数据下载说明,在TextZoom测试集合上超分算法效果如下:
|
||||
|
||||
|模型|骨干网络|PSNR_Avg|SSIM_Avg|配置文件|下载链接|
|
||||
|---|---|---|---|---|---|
|
||||
|Text Gestalt|tsrn|19.28|0.6560| [configs/sr/sr_tsrn_transformer_strock.yml](https://github.com/PaddlePaddle/PaddleOCR/tree/{{PADDLEOCR_GITHUB_REF}}/configs/sr/sr_tsrn_transformer_strock.yml)|[训练模型](https://paddleocr.bj.bcebos.com/sr_tsrn_transformer_strock_train.tar)|
|
||||
|
||||
## 2. 环境配置
|
||||
|
||||
请先参考[《运行环境准备》](../../ppocr/environment.md)配置PaddleOCR运行环境,参考[《项目克隆》](../../ppocr/blog/clone.md)克隆项目代码。
|
||||
|
||||
## 3. 模型训练、评估、预测
|
||||
|
||||
请参考[文本识别训练教程](../../ppocr/model_train/recognition.md)。PaddleOCR对代码进行了模块化,训练不同的识别模型只需要**更换配置文件**即可。
|
||||
|
||||
### 训练
|
||||
|
||||
在完成数据准备后,便可以启动训练,训练命令如下:
|
||||
|
||||
```bash linenums="1"
|
||||
#单卡训练(训练周期长,不建议)
|
||||
python3 tools/train.py -c configs/sr/sr_tsrn_transformer_strock.yml
|
||||
|
||||
# 多卡训练,通过--gpus参数指定卡号
|
||||
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/sr/sr_tsrn_transformer_strock.yml
|
||||
```
|
||||
|
||||
### 评估
|
||||
|
||||
```bash linenums="1"
|
||||
# GPU 评估, Global.pretrained_model 为待测权重
|
||||
python3 -m paddle.distributed.launch --gpus '0' tools/eval.py -c configs/sr/sr_tsrn_transformer_strock.yml -o Global.pretrained_model={path/to/weights}/best_accuracy
|
||||
```
|
||||
|
||||
### 预测
|
||||
|
||||
```bash linenums="1"
|
||||
# 预测使用的配置文件必须与训练一致
|
||||
python3 tools/infer_sr.py -c configs/sr/sr_tsrn_transformer_strock.yml -o Global.pretrained_model={path/to/weights}/best_accuracy Global.infer_img=doc/imgs_words_en/word_52.png
|
||||
```
|
||||
|
||||

|
||||
|
||||
执行命令后,上面图像的超分结果如下:
|
||||
|
||||

|
||||
|
||||
## 4. 推理部署
|
||||
|
||||
### 4.1 Python推理
|
||||
|
||||
首先将文本超分训练过程中保存的模型,转换成inference model。以 Text-Gestalt 训练的[模型](https://paddleocr.bj.bcebos.com/sr_tsrn_transformer_strock_train.tar) 为例,可以使用如下命令进行转换:
|
||||
|
||||
```bash linenums="1"
|
||||
python3 tools/export_model.py -c configs/sr/sr_tsrn_transformer_strock.yml -o Global.pretrained_model={path/to/weights}/best_accuracy Global.save_inference_dir=./inference/sr_out
|
||||
```
|
||||
|
||||
Text-Gestalt 文本超分模型推理,可以执行如下命令:
|
||||
|
||||
```bash linenums="1"
|
||||
python3 tools/infer/predict_sr.py --sr_model_dir=./inference/sr_out --image_dir=doc/imgs_words_en/word_52.png --sr_image_shape=3,32,128
|
||||
```
|
||||
|
||||
执行命令后,图像的超分结果如下:
|
||||
|
||||

|
||||
|
||||
### 4.2 C++推理
|
||||
|
||||
暂未支持
|
||||
|
||||
### 4.3 Serving服务化部署
|
||||
|
||||
暂未支持
|
||||
|
||||
### 4.4 更多推理部署
|
||||
|
||||
暂未支持
|
||||
|
||||
## 5. FAQ
|
||||
|
||||
## 引用
|
||||
|
||||
```bibtex
|
||||
@inproceedings{chen2022text,
|
||||
title={Text gestalt: Stroke-aware scene text image super-resolution},
|
||||
author={Chen, Jingye and Yu, Haiyang and Ma, Jianqi and Li, Bin and Xue, Xiangyang},
|
||||
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
|
||||
volume={36},
|
||||
number={1},
|
||||
pages={285--293},
|
||||
year={2022}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,110 @@
|
||||
---
|
||||
comments: true
|
||||
---
|
||||
|
||||
# Text Gestalt
|
||||
|
||||
## 1. Introduction
|
||||
|
||||
Paper:
|
||||
> [Scene Text Telescope: Text-Focused Scene Image Super-Resolution](https://openaccess.thecvf.com/content/CVPR2021/papers/Chen_Scene_Text_Telescope_Text-Focused_Scene_Image_Super-Resolution_CVPR_2021_paper.pdf)
|
||||
> Chen, Jingye, Bin Li, and Xiangyang Xue
|
||||
> CVPR, 2021
|
||||
|
||||
Referring to the [FudanOCR](https://github.com/FudanVI/FudanOCR/tree/main/scene-text-telescope) data download instructions, the effect of the super-score algorithm on the TextZoom test set is as follows:
|
||||
|
||||
|Model|Backbone|config|Acc|Download link|
|
||||
|---|---|---|---|---|
|
||||
|Text Gestalt|tsrn|21.56|0.7411| [configs/sr/sr_telescope.yml](https://github.com/PaddlePaddle/PaddleOCR/tree/{{PADDLEOCR_GITHUB_REF}}/configs/sr/sr_telescope.yml)|[train model](https://paddleocr.bj.bcebos.com/contribution/sr_telescope_train.tar)|
|
||||
|
||||
The [TextZoom dataset](https://paddleocr.bj.bcebos.com/dataset/TextZoom.tar) comes from two superfraction data sets, RealSR and SR-RAW, both of which contain LR-HR pairs. TextZoom has 17367 pairs of training data and 4373 pairs of test data.
|
||||
|
||||
## 2. Environment
|
||||
|
||||
Please refer to ["Environment Preparation"](../../ppocr/environment.en.md) to configure the PaddleOCR environment, and refer to ["Project Clone"](../../ppocr/blog/clone.en.md)to clone the project code.
|
||||
|
||||
## 3. Model Training / Evaluation / Prediction
|
||||
|
||||
Please refer to [Text Recognition Tutorial](../../ppocr/model_train/recognition.en.md). PaddleOCR modularizes the code, and training different models only requires **changing the configuration file**.
|
||||
|
||||
### Training
|
||||
|
||||
Specifically, after the data preparation is completed, the training can be started. The training command is as follows:
|
||||
|
||||
```bash linenums="1"
|
||||
# Single GPU training (long training period, not recommended)
|
||||
python3 tools/train.py -c configs/sr/sr_telescope.yml
|
||||
|
||||
# Multi GPU training, specify the gpu number through the --gpus parameter
|
||||
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/sr/sr_telescope.yml
|
||||
```
|
||||
|
||||
### Evaluation
|
||||
|
||||
```bash linenums="1"
|
||||
# GPU evaluation
|
||||
python3 -m paddle.distributed.launch --gpus '0' tools/eval.py -c configs/sr/sr_telescope.yml -o Global.pretrained_model={path/to/weights}/best_accuracy
|
||||
```
|
||||
|
||||
### Prediction
|
||||
|
||||
```bash linenums="1"
|
||||
# The configuration file used for prediction must match the training
|
||||
|
||||
python3 tools/infer_sr.py -c configs/sr/sr_telescope.yml -o Global.pretrained_model={path/to/weights}/best_accuracy Global.infer_img=doc/imgs_words_en/word_52.png
|
||||
```
|
||||
|
||||

|
||||
|
||||
After executing the command, the super-resolution result of the above image is as follows:
|
||||
|
||||

|
||||
|
||||
## 4. Inference and Deployment
|
||||
|
||||
### 4.1 Python Inference
|
||||
|
||||
First, the model saved during the training process is converted into an inference model. ( [Model download link](https://paddleocr.bj.bcebos.com/contribution/Telescope_train.tar.gz) ), you can use the following command to convert:
|
||||
|
||||
```bash linenums="1"
|
||||
python3 tools/export_model.py -c configs/sr/sr_telescope.yml -o Global.pretrained_model={path/to/weights}/best_accuracy Global.save_inference_dir=./inference/sr_out
|
||||
```
|
||||
|
||||
For Text-Telescope super-resolution model inference, the following commands can be executed:
|
||||
|
||||
```bash linenums="1"
|
||||
python3 tools/infer/predict_sr.py --sr_model_dir=./inference/sr_out --image_dir=doc/imgs_words_en/word_52.png --sr_image_shape=3,32,128
|
||||
|
||||
```
|
||||
|
||||
After executing the command, the super-resolution result of the above image is as follows:
|
||||
|
||||

|
||||
|
||||
### 4.2 C++ Inference
|
||||
|
||||
Not supported
|
||||
|
||||
### 4.3 Serving
|
||||
|
||||
Not supported
|
||||
|
||||
### 4.4 More
|
||||
|
||||
Not supported
|
||||
|
||||
## 5. FAQ
|
||||
|
||||
## Citation
|
||||
|
||||
```bibtex
|
||||
@INPROCEEDINGS{9578891,
|
||||
author={Chen, Jingye and Li, Bin and Xue, Xiangyang},
|
||||
booktitle={2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
|
||||
title={Scene Text Telescope: Text-Focused Scene Image Super-Resolution},
|
||||
year={2021},
|
||||
volume={},
|
||||
number={},
|
||||
pages={12021-12030},
|
||||
doi={10.1109/CVPR46437.2021.01185}}
|
||||
```
|
||||
@@ -0,0 +1,109 @@
|
||||
---
|
||||
typora-copy-images-to: images
|
||||
comments: true
|
||||
---
|
||||
|
||||
# Text Telescope
|
||||
|
||||
## 1. 算法简介
|
||||
|
||||
论文信息:
|
||||
> [Scene Text Telescope: Text-Focused Scene Image Super-Resolution](https://openaccess.thecvf.com/content/CVPR2021/papers/Chen_Scene_Text_Telescope_Text-Focused_Scene_Image_Super-Resolution_CVPR_2021_paper.pdf)
|
||||
> Chen, Jingye, Bin Li, and Xiangyang Xue
|
||||
> CVPR, 2021
|
||||
|
||||
参考[FudanOCR](https://github.com/FudanVI/FudanOCR/tree/main/scene-text-telescope) 数据下载说明,在TextZoom测试集合上超分算法效果如下:
|
||||
|
||||
|模型|骨干网络|PSNR_Avg|SSIM_Avg|配置文件|下载链接|
|
||||
|---|---|---|---|---|---|
|
||||
|Text Telescope|tbsrn|21.56|0.7411| [configs/sr/sr_telescope.yml](https://github.com/PaddlePaddle/PaddleOCR/tree/{{PADDLEOCR_GITHUB_REF}}/configs/sr/sr_telescope.yml)|[训练模型](https://paddleocr.bj.bcebos.com/contribution/sr_telescope_train.tar)|
|
||||
|
||||
[TextZoom数据集](https://paddleocr.bj.bcebos.com/dataset/TextZoom.tar) 来自两个超分数据集RealSR和SR-RAW,两个数据集都包含LR-HR对,TextZoom有17367对训数据和4373对测试数据。
|
||||
|
||||
## 2. 环境配置
|
||||
|
||||
请先参考[《运行环境准备》](../../ppocr/environment.md)配置PaddleOCR运行环境,参考[《项目克隆》](../../ppocr/blog/clone.md)克隆项目代码。
|
||||
|
||||
## 3. 模型训练、评估、预测
|
||||
|
||||
请参考[文本识别训练教程](../../ppocr/model_train/recognition.md)。PaddleOCR对代码进行了模块化,训练不同的识别模型只需要**更换配置文件**即可。
|
||||
|
||||
### 训练
|
||||
|
||||
在完成数据准备后,便可以启动训练,训练命令如下:
|
||||
|
||||
```bash linenums="1"
|
||||
#单卡训练(训练周期长,不建议)
|
||||
python3 tools/train.py -c configs/sr/sr_telescope.yml
|
||||
|
||||
# 多卡训练,通过--gpus参数指定卡号
|
||||
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/sr/sr_telescope.yml
|
||||
```
|
||||
|
||||
### 评估
|
||||
|
||||
```bash linenums="1"
|
||||
# GPU 评估, Global.pretrained_model 为待测权重
|
||||
python3 -m paddle.distributed.launch --gpus '0' tools/eval.py -c configs/sr/sr_telescope.yml -o Global.pretrained_model={path/to/weights}/best_accuracy
|
||||
```
|
||||
|
||||
### 预测
|
||||
|
||||
```bash linenums="1"
|
||||
# 预测使用的配置文件必须与训练一致
|
||||
python3 tools/infer_sr.py -c configs/sr/sr_telescope.yml -o Global.pretrained_model={path/to/weights}/best_accuracy Global.infer_img=doc/imgs_words_en/word_52.png
|
||||
```
|
||||
|
||||

|
||||
|
||||
执行命令后,上面图像的超分结果如下:
|
||||
|
||||

|
||||
|
||||
## 4. 推理部署
|
||||
|
||||
### 4.1 Python推理
|
||||
|
||||
首先将文本超分训练过程中保存的模型,转换成inference model。以 Text-Telescope 训练的[模型](https://paddleocr.bj.bcebos.com/contribution/Telescope_train.tar.gz) 为例,可以使用如下命令进行转换:
|
||||
|
||||
```bash linenums="1"
|
||||
python3 tools/export_model.py -c configs/sr/sr_telescope.yml -o Global.pretrained_model={path/to/weights}/best_accuracy Global.save_inference_dir=./inference/sr_out
|
||||
```
|
||||
|
||||
Text-Telescope 文本超分模型推理,可以执行如下命令:
|
||||
|
||||
```bash linenums="1"
|
||||
python3 tools/infer/predict_sr.py --sr_model_dir=./inference/sr_out --image_dir=doc/imgs_words_en/word_52.png --sr_image_shape=3,32,128
|
||||
```
|
||||
|
||||
执行命令后,图像的超分结果如下:
|
||||
|
||||

|
||||
|
||||
### 4.2 C++推理
|
||||
|
||||
暂未支持
|
||||
|
||||
### 4.3 Serving服务化部署
|
||||
|
||||
暂未支持
|
||||
|
||||
### 4.4 更多推理部署
|
||||
|
||||
暂未支持
|
||||
|
||||
## 5. FAQ
|
||||
|
||||
## 引用
|
||||
|
||||
```bibtex
|
||||
@INPROCEEDINGS{9578891,
|
||||
author={Chen, Jingye and Li, Bin and Xue, Xiangyang},
|
||||
booktitle={2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
|
||||
title={Scene Text Telescope: Text-Focused Scene Image Super-Resolution},
|
||||
year={2021},
|
||||
volume={},
|
||||
number={},
|
||||
pages={12021-12030},
|
||||
doi={10.1109/CVPR46437.2021.01185}}
|
||||
```
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Reference in New Issue
Block a user