PaddleOCR/tests
dyning 988afe1ab9
Update readme.md
2021-09-16 10:52:25 +08:00
..
configs add server_rec params and update prepare for serving 2021-09-09 14:56:56 +08:00
results update results for opencv 4.4 2021-09-07 11:23:44 +00:00
compare_results.py fix comment 2021-08-26 03:40:28 +00:00
ocr_det_params.txt surpport ocr_system for cpp cice 2021-09-08 02:43:27 +00:00
ocr_det_server_params.txt rename tests/configs/det_r50_db.yml 2021-08-31 13:08:16 +00:00
ocr_ppocr_mobile_params.txt polish tests for rec and server 2021-09-08 15:57:18 +08:00
ocr_ppocr_server_params.txt polish tests for rec and server 2021-09-08 15:57:18 +08:00
ocr_rec_params.txt polish tests for rec and server 2021-09-08 15:57:18 +08:00
ocr_rec_server_params.txt add server_rec params and update prepare for serving 2021-09-09 14:56:56 +08:00
prepare.sh add server_rec params and update prepare for serving 2021-09-09 14:56:56 +08:00
readme.md Update readme.md 2021-09-16 10:52:25 +08:00
test.sh fix typo for serving 2021-09-13 09:24:09 +00:00

readme.md

介绍

test.sh和params.txt文件配合使用完成OCR轻量检测和识别模型从训练到预测的流程测试。

安装依赖

  • 安装PaddlePaddle >= 2.0
  • 安装PaddleOCR依赖
    pip3 install  -r ../requirements.txt
    
  • 安装autolog
    git clone https://github.com/LDOUBLEV/AutoLog
    cd AutoLog
    pip3 install -r requirements.txt
    python3 setup.py bdist_wheel
    pip3 install ./dist/auto_log-1.0.0-py3-none-any.whl
    cd ../
    

目录介绍

tests/
├── ocr_det_params.txt            # 测试OCR检测模型的参数配置文件
├── ocr_rec_params.txt            # 测试OCR识别模型的参数配置文件
├── ocr_ppocr_mobile_params.txt   # 测试OCR检测+识别模型串联的参数配置文件
└── prepare.sh                    # 完成test.sh运行所需要的数据和模型下载
└── test.sh                       # 测试主程序

使用方法

test.sh包含四种运行模式每种模式的运行数据不同分别用于测试速度和精度分别是

  • 模式1lite_train_infer使用少量数据训练用于快速验证训练到预测的走通流程不验证精度和速度
bash tests/prepare.sh ./tests/ocr_det_params.txt 'lite_train_infer'
bash tests/test.sh ./tests/ocr_det_params.txt 'lite_train_infer'
  • 模式2whole_infer使用少量数据训练一定量数据预测用于验证训练后的模型执行预测预测速度是否合理
bash tests/prepare.sh ./tests/ocr_det_params.txt 'whole_infer'
bash tests/test.sh ./tests/ocr_det_params.txt 'whole_infer'
  • 模式3infer 不训练全量数据预测走通开源模型评估、动转静检查inference model预测时间和精度;
bash tests/prepare.sh ./tests/ocr_det_params.txt 'infer'
# 用法1:
bash tests/test.sh ./tests/ocr_det_params.txt 'infer'
# 用法2: 指定GPU卡预测第三个传入参数为GPU卡号
bash tests/test.sh ./tests/ocr_det_params.txt 'infer' '1'
  • 模式4whole_train_infer , CE 全量数据训练,全量数据预测,验证模型训练精度,预测精度,预测速度;
bash tests/prepare.sh ./tests/ocr_det_params.txt 'whole_train_infer'
bash tests/test.sh ./tests/ocr_det_params.txt 'whole_train_infer'
  • 模式5cpp_infer , CE 验证inference model的c++预测是否走通;
bash tests/prepare.sh ./tests/ocr_det_params.txt 'cpp_infer'
bash tests/test.sh ./tests/ocr_det_params.txt 'cpp_infer'