__init__.py 630 B

123456789101112131415161718192021
  1. # -*- coding: utf-8 -*-
  2. # @Time : 2020/5/15 17:42
  3. # @Author : zhoujun
  4. from addict import Dict
  5. import copy
  6. from .RecModel import RecModel
  7. from .DetModel import DetModel
  8. from .DistillationDetModel import DistillationModel
  9. support_model = ['RecModel', 'DetModel','DistillationModel']
  10. def build_model(config):
  11. """
  12. get architecture model class
  13. """
  14. copy_config = copy.deepcopy(config)
  15. arch_type = copy_config.pop('type')
  16. assert arch_type in support_model, f'{arch_type} is not developed yet!, only {support_model} are support now'
  17. arch_model = eval(arch_type)(Dict(copy_config))
  18. return arch_model