def METHOD_NAME(cfg, args):
    default_hooks = cfg.default_hooks
    if 'visualization' in default_hooks:
        visualization_hook = default_hooks['visualization']
        # Turn on visualization
        visualization_hook['enable'] = True
        visualization_hook['draw_gt'] = True
        visualization_hook['draw_pred'] = True
        if args.show:
            visualization_hook['show'] = True
            visualization_hook['wait_time'] = args.wait_time
        if args.show_dir:
            cfg.visualizer['save_dir'] = args.show_dir
            cfg.visualizer['vis_backends'] = [dict(type='LocalVisBackend')]
    else:
        raise RuntimeError(
            'VisualizationHook must be included in default_hooks.'
            'refer to usage '
            '"visualization=dict(type=\'VisualizationHook\')"')
    return cfg