params.py 1.33 KB
Newer Older
WenmuZhou's avatar
WenmuZhou committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 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.

dyning's avatar
dyning committed
15
16
17
18
19
20
21
22
23
24
25
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function


class Config(object):
    pass


def read_params():
    cfg = Config()
WenmuZhou's avatar
WenmuZhou committed
26

dyning's avatar
dyning committed
27
28
    #params for text detector
    cfg.det_algorithm = "DB"
andyjpaddle's avatar
andyjpaddle committed
29
    cfg.det_model_dir = "./inference/ch_PP-OCRv3_det_infer/"
WenmuZhou's avatar
WenmuZhou committed
30
31
    cfg.det_limit_side_len = 960
    cfg.det_limit_type = 'max'
dyning's avatar
dyning committed
32
33

    #DB parmas
WenmuZhou's avatar
WenmuZhou committed
34
    cfg.det_db_thresh = 0.3
Double_V's avatar
Double_V committed
35
36
    cfg.det_db_box_thresh = 0.6
    cfg.det_db_unclip_ratio = 1.5
37
    cfg.use_dilation = False
littletomatodonkey's avatar
littletomatodonkey committed
38
    cfg.det_db_score_mode = "fast"
dyning's avatar
dyning committed
39
40
41
42
43
44

    # #EAST parmas
    # cfg.det_east_score_thresh = 0.8
    # cfg.det_east_cover_thresh = 0.1
    # cfg.det_east_nms_thresh = 0.2

WenmuZhou's avatar
WenmuZhou committed
45
    cfg.use_pdserving = False
WenmuZhou's avatar
WenmuZhou committed
46
    cfg.use_tensorrt = False
MissPenguin's avatar
MissPenguin committed
47
48

    return cfg