|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__all__ = ['build_head'] |
|
|
|
|
|
def build_head(config): |
|
|
|
from .det_db_head import DBHead |
|
from .det_east_head import EASTHead |
|
from .det_sast_head import SASTHead |
|
from .det_pse_head import PSEHead |
|
from .det_fce_head import FCEHead |
|
from .e2e_pg_head import PGHead |
|
from .det_ct_head import CT_Head |
|
|
|
|
|
from .rec_ctc_head import CTCHead |
|
from .rec_att_head import AttentionHead |
|
from .rec_srn_head import SRNHead |
|
from .rec_nrtr_head import Transformer |
|
from .rec_sar_head import SARHead |
|
from .rec_aster_head import AsterHead |
|
from .rec_pren_head import PRENHead |
|
from .rec_multi_head import MultiHead |
|
from .rec_spin_att_head import SPINAttentionHead |
|
from .rec_abinet_head import ABINetHead |
|
from .rec_robustscanner_head import RobustScannerHead |
|
from .rec_visionlan_head import VLHead |
|
from .rec_rfl_head import RFLHead |
|
from .rec_can_head import CANHead |
|
|
|
|
|
from .cls_head import ClsHead |
|
|
|
|
|
from .kie_sdmgr_head import SDMGRHead |
|
|
|
from .table_att_head import TableAttentionHead, SLAHead |
|
from .table_master_head import TableMasterHead |
|
|
|
support_dict = [ |
|
'DBHead', 'PSEHead', 'FCEHead', 'EASTHead', 'SASTHead', 'CTCHead', |
|
'ClsHead', 'AttentionHead', 'SRNHead', 'PGHead', 'Transformer', |
|
'TableAttentionHead', 'SARHead', 'AsterHead', 'SDMGRHead', 'PRENHead', |
|
'MultiHead', 'ABINetHead', 'TableMasterHead', 'SPINAttentionHead', |
|
'VLHead', 'SLAHead', 'RobustScannerHead', 'CT_Head', 'RFLHead', |
|
'DRRGHead', 'CANHead' |
|
] |
|
|
|
if config['name'] == 'DRRGHead': |
|
from .det_drrg_head import DRRGHead |
|
support_dict.append('DRRGHead') |
|
|
|
|
|
|
|
module_name = config.pop('name') |
|
assert module_name in support_dict, Exception('head only support {}'.format( |
|
support_dict)) |
|
module_class = eval(module_name)(**config) |
|
return module_class |
|
|