MCPcopy
hub / github.com/XPixelGroup/DiffBIR / instantiate_from_config

Function instantiate_from_config

diffbir/utils/common.py:23–26  ·  view source on GitHub ↗
(config: Mapping[str, Any])

Source from the content-addressed store, hash-verified

21
22
23def instantiate_from_config(config: Mapping[str, Any]) -> Any:
24 if not "target" in config:
25 raise KeyError("Expected key `target` to instantiate.")
26 return get_obj_from_str(config["target"])(**config.get("params", dict()))
27
28
29def wavelet_blur(image: Tensor, radius: int):

Callers 10

mainFunction · 0.90
run_gradio.pyFile · 0.90
mainFunction · 0.90
__init__Method · 0.85
__init__Method · 0.85
load_cleanerMethod · 0.85
load_cleanerMethod · 0.85
load_cleanerMethod · 0.85
load_cleanerMethod · 0.85
load_cldmMethod · 0.85

Calls 2

get_obj_from_strFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected