How to use the spleeter.commands.create_argument_parser function in spleeter

To help you get started, we’ve selected a few spleeter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deezer / spleeter / spleeter / __main__.py View on Github external
def main(argv):
    """ Spleeter runner. Parse provided command line arguments
    and run entrypoint for required command (either train,
    evaluate or separate).

    :param argv: Provided command line arguments.
    """
    try:
        parser = create_argument_parser()
        arguments = parser.parse_args(argv[1:])
        enable_logging()
        if arguments.verbose:
            enable_tensorflow_logging()
        if arguments.command == 'separate':
            from .commands.separate import entrypoint
        elif arguments.command == 'train':
            from .commands.train import entrypoint
        elif arguments.command == 'evaluate':
            from .commands.evaluate import entrypoint
        params = load_configuration(arguments.configuration)
        entrypoint(arguments, params)
    except SpleeterError as e:
        get_logger().error(e)