コード例 #1
0
parser = ArgumentParser('program to convert source files to traindata format')
parser.add_argument(
    "-i",
    help="set input sample description (output from the check.py script)",
    metavar="FILE")
parser.add_argument("--inRange", nargs=2, type=int, help="Input line numbers")
parser.add_argument(
    "--noRelativePaths",
    help=
    "Assume input samples are absolute paths with respect to working directory",
    default=False,
    action="store_true")
parser.add_argument("-o", help="set output path", metavar="PATH")
parser.add_argument("-c",
                    choices=class_options.keys(),
                    help="set output class (options: %s)" %
                    ', '.join(class_options.keys()),
                    metavar="Class")
parser.add_argument("-r",
                    help="set path to snapshot that got interrupted",
                    metavar="FILE",
                    default='')
parser.add_argument("-n",
                    default='',
                    help="(optional) number of child processes")
parser.add_argument("--usemeansfrom", default='')
parser.add_argument("--nothreads", action='store_true')
parser.add_argument("--means", action='store_true', help='compute only means')
parser.add_argument(
    "--nforweighter",
コード例 #2
0
#!/usr/bin/env python3
# encoding: utf-8
'''

@author:     jkiesele

'''

from argparse import ArgumentParser
from DeepJetCore.conversion.conversion import class_options

parser = ArgumentParser('simple program to convert old (pre 2.0) traindata format to the new one')
parser.add_argument("infile", help="input \"meta\" file")
parser.add_argument("-c",  choices = class_options.keys(), help="set new output class (options: %s)" % ', '.join(class_options.keys()), metavar="Class")
# process options
args=parser.parse_args()
infile=args.infile
class_name = args.c

if class_name in class_options:
    traind = class_options[class_name]
else:
    print('available classes:')
    for key, val in class_options.iteritems():
        print(key)
    raise Exception('wrong class selection')


if not ".meta" in infile:
    print('wrong input file '+infile)
    exit()