zhoujun 68099c2d5b
add db for benchmark (#8959)
* Add custom detection and recognition model usage instructions in re

* update

* Add custom detection and recognition model usage instructions in re

* add db net for benchmark

* rename benckmark to PaddleOCR_benchmark

* add addict to req

* rename
2023-02-08 15:52:30 +08:00

21 lines
547 B
Python

# -*- coding: utf-8 -*-
# @Time : 2019/8/23 21:55
# @Author : zhoujun
import copy
from .model import Model
from .losses import build_loss
__all__ = ['build_loss', 'build_model']
support_model = ['Model']
def build_model(config):
"""
get architecture model class
"""
copy_config = copy.deepcopy(config)
arch_type = copy_config.pop('type')
assert arch_type in support_model, f'{arch_type} is not developed yet!, only {support_model} are support now'
arch_model = eval(arch_type)(copy_config)
return arch_model