2022-03-31 08:37:50 +08:00
|
|
|
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2020-07-12 16:05:28 +08:00
|
|
|
from __future__ import absolute_import
|
|
|
|
from __future__ import division
|
|
|
|
from __future__ import print_function
|
|
|
|
|
|
|
|
|
|
|
|
class Config(object):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def read_params():
|
|
|
|
cfg = Config()
|
|
|
|
|
|
|
|
#params for text recognizer
|
|
|
|
cfg.rec_algorithm = "CRNN"
|
2022-05-05 16:19:06 +08:00
|
|
|
cfg.rec_model_dir = "./inference/ch_PP-OCRv3_rec_infer/"
|
2020-07-12 16:05:28 +08:00
|
|
|
|
2022-05-05 16:19:06 +08:00
|
|
|
cfg.rec_image_shape = "3, 48, 320"
|
2022-04-08 16:10:54 +08:00
|
|
|
cfg.rec_batch_num = 6
|
2020-08-20 11:30:18 +08:00
|
|
|
cfg.max_text_length = 25
|
|
|
|
|
2020-07-12 16:05:28 +08:00
|
|
|
cfg.rec_char_dict_path = "./ppocr/utils/ppocr_keys_v1.txt"
|
|
|
|
cfg.use_space_char = True
|
|
|
|
|
2020-12-01 17:46:50 +08:00
|
|
|
cfg.use_pdserving = False
|
2021-01-04 12:11:21 +08:00
|
|
|
cfg.use_tensorrt = False
|
2020-08-26 13:01:51 +08:00
|
|
|
|
|
|
|
return cfg
|