(config, global_config=None)
| 64 | |
| 65 | |
| 66 | def build_post_process(config, global_config=None): |
| 67 | support_dict = [ |
| 68 | "DBPostProcess", |
| 69 | "EASTPostProcess", |
| 70 | "SASTPostProcess", |
| 71 | "FCEPostProcess", |
| 72 | "CTCLabelDecode", |
| 73 | "AttnLabelDecode", |
| 74 | "ClsPostProcess", |
| 75 | "SRNLabelDecode", |
| 76 | "PGPostProcess", |
| 77 | "DistillationCTCLabelDecode", |
| 78 | "TableLabelDecode", |
| 79 | "DistillationDBPostProcess", |
| 80 | "NRTRLabelDecode", |
| 81 | "SARLabelDecode", |
| 82 | "SEEDLabelDecode", |
| 83 | "VQASerTokenLayoutLMPostProcess", |
| 84 | "VQAReTokenLayoutLMPostProcess", |
| 85 | "PRENLabelDecode", |
| 86 | "DistillationSARLabelDecode", |
| 87 | "ViTSTRLabelDecode", |
| 88 | "ABINetLabelDecode", |
| 89 | "TableMasterLabelDecode", |
| 90 | "SPINLabelDecode", |
| 91 | "DistillationSerPostProcess", |
| 92 | "DistillationRePostProcess", |
| 93 | "VLLabelDecode", |
| 94 | "PicoDetPostProcess", |
| 95 | "CTPostProcess", |
| 96 | "RFLLabelDecode", |
| 97 | "DRRGPostprocess", |
| 98 | "CANLabelDecode", |
| 99 | "SATRNLabelDecode", |
| 100 | "ParseQLabelDecode", |
| 101 | "CPPDLabelDecode", |
| 102 | "LaTeXOCRDecode", |
| 103 | "UniMERNetDecode", |
| 104 | ] |
| 105 | |
| 106 | if config["name"] == "PSEPostProcess": |
| 107 | from .pse_postprocess import PSEPostProcess |
| 108 | |
| 109 | support_dict.append("PSEPostProcess") |
| 110 | |
| 111 | config = copy.deepcopy(config) |
| 112 | module_name = config.pop("name") |
| 113 | if module_name == "None": |
| 114 | return |
| 115 | if global_config is not None: |
| 116 | config.update(global_config) |
| 117 | assert module_name in support_dict, Exception( |
| 118 | "post process only support {}".format(support_dict) |
| 119 | ) |
| 120 | module_class = eval(module_name)(**config) |
| 121 | return module_class |
searching dependent graphs…