__init__.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. __all__ = ['build_neck']
  15. def build_neck(config):
  16. from .db_fpn import DBFPN, RSEFPN, LKPAN
  17. from .east_fpn import EASTFPN
  18. from .sast_fpn import SASTFPN
  19. from .rnn import SequenceEncoder
  20. from .pg_fpn import PGFPN
  21. from .table_fpn import TableFPN
  22. from .fpn import FPN
  23. from .fce_fpn import FCEFPN
  24. from .pren_fpn import PRENFPN
  25. from .csp_pan import CSPPAN
  26. from .ct_fpn import CTFPN
  27. from .fpn_unet import FPN_UNet
  28. from .rf_adaptor import RFAdaptor
  29. support_dict = [
  30. 'FPN', 'FCEFPN', 'LKPAN', 'DBFPN', 'RSEFPN', 'EASTFPN', 'SASTFPN',
  31. 'SequenceEncoder', 'PGFPN', 'TableFPN', 'PRENFPN', 'CSPPAN', 'CTFPN',
  32. 'RFAdaptor', 'FPN_UNet'
  33. ]
  34. module_name = config.pop('name')
  35. assert module_name in support_dict, Exception('neck only support {}'.format(
  36. support_dict))
  37. module_class = eval(module_name)(**config)
  38. return module_class