forked from PaddlePaddle/PaddleSlim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add ppocrv3_rec * fix eval.py
- Loading branch information
Showing
5 changed files
with
6,769 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
example/auto_compression/ocr/configs/ppocrv3_rec_qat_dist.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
Global: | ||
model_dir: ch_PP-OCRv3_rec_infer | ||
model_filename: inference.pdmodel | ||
params_filename: inference.pdiparams | ||
model_type: rec | ||
algorithm: SVTR | ||
character_dict_path: ./ppocr_keys_v1.txt | ||
max_text_length: &max_text_length 25 | ||
use_space_char: true | ||
|
||
Distillation: | ||
alpha: [1.0, 1.0] | ||
loss: ['skd', 'l2'] | ||
node: | ||
- ['linear_43.tmp_1'] | ||
- ['linear_43.tmp_1'] | ||
|
||
Quantization: | ||
use_pact: true | ||
activation_bits: 8 | ||
is_full_quantize: false | ||
onnx_format: True | ||
activation_quantize_type: moving_average_abs_max | ||
weight_quantize_type: channel_wise_abs_max | ||
not_quant_pattern: | ||
- skip_quant | ||
quantize_op_types: | ||
- conv2d | ||
- depthwise_conv2d | ||
weight_bits: 8 | ||
|
||
TrainConfig: | ||
epochs: 10 | ||
eval_iter: 2000 | ||
logging_iter: 100 | ||
learning_rate: | ||
type: CosineAnnealingDecay | ||
learning_rate: 0.00005 | ||
optimizer_builder: | ||
optimizer: | ||
type: Adam | ||
weight_decay: 5.0e-05 | ||
|
||
PostProcess: | ||
name: CTCLabelDecode | ||
|
||
Metric: | ||
name: RecMetric | ||
main_indicator: acc | ||
ignore_space: False | ||
|
||
Train: | ||
dataset: | ||
name: SimpleDataSet | ||
data_dir: ./train_data/icdar2015/text_localization/ | ||
ext_op_transform_idx: 1 | ||
label_file_list: | ||
- ./train_data/icdar2015/text_localization/train_icdar2015_label.txt | ||
transforms: | ||
- DecodeImage: | ||
img_mode: BGR | ||
channel_first: false | ||
- RecConAug: | ||
prob: 0.5 | ||
ext_data_num: 2 | ||
image_shape: [48, 320, 3] | ||
max_text_length: *max_text_length | ||
- RecAug: | ||
- MultiLabelEncode: | ||
- RecResizeImg: | ||
image_shape: [3, 48, 320] | ||
- KeepKeys: | ||
keep_keys: | ||
- image | ||
- label_ctc | ||
- label_sar | ||
- length | ||
- valid_ratio | ||
loader: | ||
shuffle: true | ||
batch_size_per_card: 64 | ||
drop_last: true | ||
num_workers: 0 | ||
|
||
Eval: | ||
dataset: | ||
name: SimpleDataSet | ||
data_dir: ./train_data/icdar2015/text_localization/ | ||
label_file_list: | ||
- ./train_data/icdar2015/text_localization/test_icdar2015_label.txt | ||
transforms: | ||
- DecodeImage: | ||
img_mode: BGR | ||
channel_first: false | ||
- MultiLabelEncode: | ||
- RecResizeImg: | ||
image_shape: [3, 48, 320] | ||
- KeepKeys: | ||
keep_keys: | ||
- image | ||
- label_ctc | ||
- label_sar | ||
- length | ||
- valid_ratio | ||
loader: | ||
shuffle: false | ||
drop_last: false | ||
batch_size_per_card: 64 | ||
num_workers: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.