(add_help=True)
return args
parse args
parse args
parse args
def get_args(add_help=True):
    """
    parse args
    """
    import argparse

    def str2bool(v):
        return v.lower() in ("true", "t", "1")

    parser = argparse.ArgumentParser(
        description="PaddlePaddle Classification Training", add_help=add_help)

    parser.add_argument(
        "--model-dir", default=None, help="inference model dir")
    parser.add_argument(
        "--use-gpu", default=False, type=str2bool, help="use_gpu")
    parser.add_argument(
        "--max-batch-size", default=16, type=int, help="max_batch_size")
    parser.add_argument("--batch-size", default=1, type=int, help="batch size")

    parser.add_argument(
        "--resize-size", default=256, type=int, help="resize_size")
    parser.add_argument("--crop-size", default=224, type=int, help="crop_szie")
    parser.add_argument("--img-path", default="./images/demo.jpg")

    parser.add_argument(
        "--benchmark", default=False, type=str2bool, help="benchmark")
    parser.add_argument("--warmup", default=0, type=int, help="warmup iter")

    args = parser.parse_args()
    return args
def get_args ( add_help = True ) : import argparse def str2bool ( v ) : return v . lower ( ) in ( "true" , "t" , "1" ) parser = argparse . ArgumentParser ( description = "PaddlePaddle Classification Training" , add_help = add_help ) parser . add_argument ( "--model-dir" , default = None , help = "inference model dir" ) parser . add_argument ( "--use-gpu" , default = False , type = str2bool , help = "use_gpu" ) parser . add_argument ( "--max-batch-size" , default = 16 , type = int , help = "max_batch_size" ) parser . add_argument ( "--batch-size" , default = 1 , type = int , help = "batch size" ) parser . add_argument ( "--resize-size" , default = 256 , type = int , help = "resize_size" ) parser . add_argument ( "--crop-size" , default = 224 , type = int , help = "crop_szie" ) parser . add_argument ( "--img-path" , default = "./images/demo.jpg" ) parser . add_argument ( "--benchmark" , default = False , type = str2bool , help = "benchmark" ) parser . add_argument ( "--warmup" , default = 0 , type = int , help = "warmup iter" ) args = parser . parse_args ( ) return args