__init__.py 746 B

123456789101112131415161718192021
  1. # -*- coding: utf-8 -*-
  2. # @Time : 2020/5/15 17:41
  3. # @Author : zhoujun
  4. import copy
  5. from .DBPostProcess import DBPostProcess,DistillationDBPostProcess
  6. # from .pse import pse_postprocess
  7. from .FCEPostProcess import FCEPostProcess
  8. support_post_process = ['DBPostProcess', 'DetModel','pse_postprocess','DistillationDBPostProcess','FCEPostProcess']
  9. def build_post_process(config):
  10. """
  11. get architecture model class
  12. """
  13. copy_config = copy.deepcopy(config)
  14. post_process_type = copy_config.pop('type')
  15. assert post_process_type in support_post_process, f'{post_process_type} is not developed yet!, only {support_post_process} are support now'
  16. post_process = eval(post_process_type)(**copy_config)
  17. return post_process