示例#1
0
def process_arguments():
    parser = ArgParserWithDefaultHelp(description='Extract frames sample tool from several folders')
    parser.add_argument('folder', help='Folder, that contains folders with frames')
    parser.add_argument('output', help='Folder, to copy selected frames')
    parser.add_argument('-s', '--size', dest='size', default='middle', choices=['large', 'middle', 'small', 'extrasmall'], help='Size of sample')
    parser.add_argument('--save-structure', dest='saveStructure', action='store_true', help='Save folder structure in output folder')
    parser.set_defaults(saveStructure=False)

    return parser.parse_args()
def process_arguments():
    parser = ArgParserWithDefaultHelp(description='Images test classifier tool')
    parser.add_argument('classifier', help='Classifier')
    parser.add_argument('folder', help='Folders with frames (divided into two parts: positive and negative examples')
    parser.add_argument('-o', '--output', help='Incorrect results folder')
    parser.add_argument('--save-correct', dest='save_correct', action='store_true', help='Save correct determined images')
    parser.add_argument('-j', '--jobs', default=-1, type=int, help='Processes amount for feature extraction')
    parser.add_argument('--verbose', dest='verbose', action='store_true', help='Debug output')
    parser.set_defaults(save_correct=False)
    parser.set_defaults(verbose=False)

    return parser.parse_args()
def process_arguments():
    parser = ArgParserWithDefaultHelp(description="Dataset creation tool from several folders")
    parser.add_argument("folder", help="Folder, that contains folders with frames")
    parser.add_argument("train", help="Train dataset")
    parser.add_argument("test", help="Test dataset")
    parser.add_argument("--train_files", default=None, help="File with list of images, that included in train set")
    parser.add_argument("--test_files", default=None, help="File with list of images, that included in test set")
    parser.add_argument(
        "-p",
        "--positive-fragments-folder",
        dest="positive_fragments_folder",
        default=None,
        help="Folder to put positive fragments of frames",
    )
    parser.add_argument("-t", "--type", default="large", choices=["large", "small"], help="Size of train set")
    parser.add_argument(
        "-m", "--negmult", default=3, type=int, help="Negative multiplicator: how more negative examples than positive"
    )
    parser.add_argument(
        "-n",
        "--neighbours-for-positive",
        dest="neighbours",
        default=7,
        type=int,
        help="Generate this neighbours amount for every positive window",
    )
    parser.add_argument("-j", "--jobs", default=-1, type=int, help="Processes amount for feature extraction")
    parser.add_argument(
        "-o",
        "--dataset-type",
        dest="dataset_type",
        default="csv",
        choices=["pkl", "csv"],
        help="Type of dataset output",
    )
    parser.add_argument("-w", "--window-size", dest="window_size", default=64, type=int, help="Window size")
    parser.add_argument("-s", "--shift-size", dest="shift_size", default=32, type=int, help="Shift size")
    parser.add_argument(
        "-r", "--features-window-size", dest="features_window_size", default=32, type=int, help="Features window size"
    )
    parser.add_argument(
        "-f", "--features-type", dest="features_type", default="hog", choices=["hog", "daisy"], help="Features detector"
    )
    parser.add_argument(
        "--only-first-symbol",
        dest="first_symbol_tag",
        action="store_true",
        help="Positive only on first symbol from tag",
    )
    parser.set_defaults(first_symbol_tag=False)

    return parser.parse_args()