def parse_args()

in eval/eval_ABX.py [0:0]


def parse_args(argv):

    parser = argparse.ArgumentParser(description='ABX metric')

    parser.add_argument('path_data', type=str,
                        help="Path to directory containing the data")
    parser.add_argument('path_item_file', type=str,
                        help="Path to the .item file")
    parser.add_argument('--path_checkpoint', type=str, default=None,
                        help="Path to a CPC checkpoint. If set, the apply the "
                        "model to the input data to compute the features")
    parser.add_argument('--file_extension', type=str, default='.pt',
                        choices=['.pt', '.npy', '.wav', '.flac', '.mp3'])
    parser.add_argument('--feature_size', type=float, default=0.01,
                        help="Size (in s) of one feature")
    parser.add_argument('--cuda', action='store_true',
                        help="Use the GPU to compute distances")
    parser.add_argument('--mode', type=str, default='all',
                        choices=['all', 'within', 'across'],
                        help="Choose the mode of the ABX score to compute")
    parser.add_argument('--distance_mode', type=str, default='cosine',
                        choices=['euclidian', 'cosine', 'kl', 'kl_symmetric'],
                        help="Choose the kind of distance to use to compute "
                        "the ABX score.")
    parser.add_argument("--max_size_group", type=int, default=10,
                        help="Max size of a group while computing the"
                             "ABX score. A small value will make the code "
                             "faster but less precise.")
    parser.add_argument("--max_x_across", type=int, default=5,
                        help="When computing the ABX across score, maximum"
                             "number of speaker X to sample per couple A,B. "
                             " A small value will make the code faster but "
                             "less precise.")
    parser.add_argument("--out", type=str, default=None,
                        help="Path where the results should be saved")

    # multi-gpu / multi-node
    return parser.parse_args(argv)