PaddleOCR/ppocr/modeling/necks/__init__.py

44 lines
1.5 KiB
Python
Raw Normal View History

# Copyright (c) 2020 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-10-13 17:13:33 +08:00
__all__ = ['build_neck']
2021-03-08 14:15:47 +08:00
2020-10-13 17:13:33 +08:00
def build_neck(config):
2022-04-27 20:15:18 +08:00
from .db_fpn import DBFPN, RSEFPN, LKPAN
2020-12-09 14:45:25 +08:00
from .east_fpn import EASTFPN
from .sast_fpn import SASTFPN
2020-10-13 17:13:33 +08:00
from .rnn import SequenceEncoder
2021-03-08 14:15:47 +08:00
from .pg_fpn import PGFPN
2021-06-16 16:47:33 +08:00
from .table_fpn import TableFPN
2021-07-27 17:29:52 +08:00
from .fpn import FPN
2022-01-27 17:36:19 +08:00
from .fce_fpn import FCEFPN
from .pren_fpn import PRENFPN
2022-08-08 14:50:27 +08:00
from .csp_pan import CSPPAN
2022-09-15 19:08:16 +08:00
from .ct_fpn import CTFPN
2022-10-08 11:56:45 +08:00
from .fpn_unet import FPN_UNet
from .rf_adaptor import RFAdaptor
2022-01-27 17:36:19 +08:00
support_dict = [
2022-04-27 19:57:48 +08:00
'FPN', 'FCEFPN', 'LKPAN', 'DBFPN', 'RSEFPN', 'EASTFPN', 'SASTFPN',
2022-10-08 11:56:45 +08:00
'SequenceEncoder', 'PGFPN', 'TableFPN', 'PRENFPN', 'CSPPAN', 'CTFPN',
'RFAdaptor', 'FPN_UNet'
2022-01-27 17:36:19 +08:00
]
2020-10-13 17:13:33 +08:00
module_name = config.pop('name')
assert module_name in support_dict, Exception('neck only support {}'.format(
support_dict))
2022-09-15 19:08:16 +08:00
2020-10-13 17:13:33 +08:00
module_class = eval(module_name)(**config)
return module_class