mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2025-11-25 14:35:58 +00:00
add words_img
This commit is contained in:
parent
d94cde77e2
commit
2e9468b763
@ -2,12 +2,12 @@ TrainReader:
|
|||||||
reader_function: ppocr.data.rec.dataset_traversal,SimpleReader
|
reader_function: ppocr.data.rec.dataset_traversal,SimpleReader
|
||||||
num_workers: 8
|
num_workers: 8
|
||||||
img_set_dir: ./train_data
|
img_set_dir: ./train_data
|
||||||
label_file_path: ./train_data/rec_gt_train.txt
|
label_file_path: ./train_data/ic15_data/rec_gt_train.txt
|
||||||
|
|
||||||
EvalReader:
|
EvalReader:
|
||||||
reader_function: ppocr.data.rec.dataset_traversal,SimpleReader
|
reader_function: ppocr.data.rec.dataset_traversal,SimpleReader
|
||||||
img_set_dir: ./train_data
|
img_set_dir: ./train_data
|
||||||
label_file_path: ./train_data/rec_gt_test.txt
|
label_file_path: ./train_data/ic15_data/rec_gt_test.txt
|
||||||
|
|
||||||
TestReader:
|
TestReader:
|
||||||
reader_function: ppocr.data.rec.dataset_traversal,SimpleReader
|
reader_function: ppocr.data.rec.dataset_traversal,SimpleReader
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
Global:
|
Global:
|
||||||
algorithm: CRNN
|
algorithm: CRNN
|
||||||
use_gpu: true
|
use_gpu: true
|
||||||
epoch_num: 3000
|
epoch_num: 1000
|
||||||
log_smooth_window: 20
|
log_smooth_window: 20
|
||||||
print_batch_step: 10
|
print_batch_step: 10
|
||||||
save_model_dir: ./output/rec_CRNN
|
save_model_dir: ./output/rec_CRNN
|
||||||
@ -14,7 +14,7 @@ Global:
|
|||||||
character_type: en
|
character_type: en
|
||||||
loss_type: ctc
|
loss_type: ctc
|
||||||
reader_yml: ./configs/rec/rec_icdar15_reader.yml
|
reader_yml: ./configs/rec/rec_icdar15_reader.yml
|
||||||
pretrain_weights: ./pretrain_models/CRNN/best_accuracy
|
pretrain_weights: ./pretrain_models/rec_mv3_none_bilstm_ctc/best_accuracy
|
||||||
checkpoints:
|
checkpoints:
|
||||||
save_inference_dir:
|
save_inference_dir:
|
||||||
Architecture:
|
Architecture:
|
||||||
|
|||||||
BIN
doc/imgs_words/word_1.jpg
Normal file
BIN
doc/imgs_words/word_1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
doc/imgs_words/word_2.jpg
Normal file
BIN
doc/imgs_words/word_2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
BIN
doc/imgs_words/word_3.jpg
Normal file
BIN
doc/imgs_words/word_3.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.8 KiB |
BIN
doc/imgs_words/word_4.jpg
Normal file
BIN
doc/imgs_words/word_4.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
BIN
doc/imgs_words/word_5.jpg
Normal file
BIN
doc/imgs_words/word_5.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@ -39,6 +39,7 @@ train_data/train_0002.jpg 用科技让复杂的世界更简单
|
|||||||
|
|
||||||
```
|
```
|
||||||
|-train_data
|
|-train_data
|
||||||
|
|-ic15_data
|
||||||
|- rec_gt_train.txt
|
|- rec_gt_train.txt
|
||||||
|- train_imags
|
|- train_imags
|
||||||
|- train_001.jpg
|
|- train_001.jpg
|
||||||
@ -53,6 +54,7 @@ train_data/train_0002.jpg 用科技让复杂的世界更简单
|
|||||||
|
|
||||||
```
|
```
|
||||||
|-train_data
|
|-train_data
|
||||||
|
|-ic15_data
|
||||||
|- rec_gt_eval.txt
|
|- rec_gt_eval.txt
|
||||||
|- eval_imags
|
|- eval_imags
|
||||||
|- eval_001.jpg
|
|- eval_001.jpg
|
||||||
@ -120,16 +122,16 @@ PaddleOCR 提供了训练好的中文模型,可以[下载](todo: add)进行快
|
|||||||
默认预测图片存储在 `infer_img` 里,通过 `-o Global.checkpoints` 指定权重:
|
默认预测图片存储在 `infer_img` 里,通过 `-o Global.checkpoints` 指定权重:
|
||||||
|
|
||||||
```
|
```
|
||||||
python tools/infer_rec.py -c configs/rec/rec_chinese_lite_train.yml -o Global.checkpoints={path/to/weights}/best_accuracy
|
python tools/infer_rec.py -c configs/rec/rec_chinese_lite_train.yml -o Global.checkpoints={path/to/weights}/best_accuracy TestReader.infer_img=doc/imgs_word/word_1.jpg
|
||||||
```
|
```
|
||||||
|
预测图片:
|
||||||
|
|
||||||
|

|
||||||
得到输入图像的预测结果:
|
得到输入图像的预测结果:
|
||||||
|
|
||||||
```
|
```
|
||||||
infer_img: infer_img/328_4.jpg
|
infer_img: doc/imgs_words/word_1.jpg
|
||||||
# 字符在字典中的索引
|
index: [2092 177 312 2503]
|
||||||
[1863 921 55 155 1863 4209 3344 486 914 1863 4918]
|
word : 韩国小馆
|
||||||
# 预测结果
|
|
||||||
冷库专用冷冻液/载冷剂
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,6 @@ set_paddle_flags(
|
|||||||
from paddle import fluid
|
from paddle import fluid
|
||||||
|
|
||||||
# from ppocr.utils.utility import load_config, merge_config
|
# from ppocr.utils.utility import load_config, merge_config
|
||||||
from ppocr.data.reader_main import test_reader
|
|
||||||
import program
|
import program
|
||||||
from paddle import fluid
|
from paddle import fluid
|
||||||
from ppocr.utils.utility import initial_logger
|
from ppocr.utils.utility import initial_logger
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user