MCPcopy
hub / github.com/PaddlePaddle/PaddleOCR / create_operators

Function create_operators

ppocr/data/imaug/__init__.py:79–96  ·  view source on GitHub ↗

create operators based on the config Args: params(list): a dict list, used to create some operators

(op_param_list, global_config=None)

Source from the content-addressed store, hash-verified

77
78
79def create_operators(op_param_list, global_config=None):
80 """
81 create operators based on the config
82
83 Args:
84 params(list): a dict list, used to create some operators
85 """
86 assert isinstance(op_param_list, list), "operator config should be a list"
87 ops = []
88 for operator in op_param_list:
89 assert isinstance(operator, dict) and len(operator) == 1, "yaml format error"
90 op_name = list(operator)[0]
91 param = {} if operator[op_name] is None else operator[op_name]
92 if global_config is not None:
93 param.update(global_config)
94 op = eval(op_name)(**param)
95 ops.append(op)
96 return ops

Callers 8

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.50
__init__Method · 0.50
__init__Method · 0.50
__init__Method · 0.50
__init__Method · 0.50

Calls 2

evalFunction · 0.50
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…