INNER CODE UNIT · Python

load_default_functions

nachifur/MulimgViewer · src/mulimgviewer/src/custom_func/main.py:47

def load_default_functions():
    algorithm_path = Path(__file__).parent / "Image Enhancement" / "main.py"
    namespace = {}
    try:
        with open(algorithm_path, 'r', encoding='utf-8') as f:
            code = f.read()
        exec(code, namespace)
        return namespace
    except:
        return {
            'custom_process_img': lambda img: img,
            'main': lambda img_list, save_path, name_list=None: img_list
        }

def custom_process_img(img, algorithm_type=0):
    functions = load_algorithm_functions(algorithm_type)
    return functions['custom_process_img'](img)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…