def parse_args():
    parser = argparse.ArgumentParser(description='Image projector to the StyleGAN-based generator latent             spaces')
    parser.add_argument('config', help='evaluation config file path')
    parser.add_argument('checkpoint', help='checkpoint file')
    parser.add_argument('files', metavar='FILES', nargs='+', help='path to image files to be projected')
    parser.add_argument('--results-path', type=str, help='path to store projection results.')
    parser.add_argument('--use-cpu', action='store_true', help='whether to use cpu device for sampling')
    parser.add_argument('--seed', type=int, default=2021, help='random seed')
    parser.add_argument('--deterministic', action='store_true', help='whether to set deterministic options for CUDNN backend.')
    parser.add_argument('--sample-model', type=str, default='ema', help='use which mode (ema/orig) in sampling.')
    parser.add_argument('--lr-rampup', type=float, default=0.05, help='proportion of the learning rate warmup iters in the total iters')
    parser.add_argument('--lr-rampdown', type=float, default=0.25, help='proportion of the learning rate decay iters in the total iters')
    parser.add_argument('--lr', type=float, default=0.1, help='maximum learning rate')
    parser.add_argument('--noise', type=float, default=0.05, help='strength of the noise level')
    parser.add_argument('--noise-ramp', type=float, default=0.75, help='proportion of the noise level decay iters in the total iters')
    parser.add_argument('--total-iters', type=int, default=1000, help='optimize iterations')
    parser.add_argument('--noise-regularize', type=float, default=100000.0, help='weight of the noise regularization')
    parser.add_argument('--mse', type=float, default=0, help='weight of the mse loss')
    parser.add_argument('--n-mean-latent', type=int, default=10000, help='sampling times to obtain the mean latent')
    parser.add_argument('--w-plus', action='store_true', help='allow to use distinct latent codes to each layers')
    args = parser.parse_args()
    return args
def parse_args():
    parser = argparse.ArgumentParser(description='Image projector to the StyleGAN-based generator latent             spaces')
    parser.add_argument('config', help='evaluation config file path')
    parser.add_argument('checkpoint', help='checkpoint file')
    parser.add_argument('files', metavar='FILES', nargs='+', help='path to image files to be projected')
    parser.add_argument('--results-path', type=str, help='path to store projection results.')
    parser.add_argument('--use-cpu', action='store_true', help='whether to use cpu device for sampling')
    parser.add_argument('--seed', type=int, default=2021, help='random seed')
    parser.add_argument('--deterministic', action='store_true', help='whether to set deterministic options for CUDNN backend.')
    parser.add_argument('--sample-model', type=str, default='ema', help='use which mode (ema/orig) in sampling.')
    parser.add_argument('--lr-rampup', type=float, default=0.05, help='proportion of the learning rate warmup iters in the total iters')
    parser.add_argument('--lr-rampdown', type=float, default=0.25, help='proportion of the learning rate decay iters in the total iters')
    parser.add_argument('--lr', type=float, default=0.1, help='maximum learning rate')
    parser.add_argument('--noise', type=float, default=0.05, help='strength of the noise level')
    parser.add_argument('--noise-ramp', type=float, default=0.75, help='proportion of the noise level decay iters in the total iters')
    parser.add_argument('--total-iters', type=int, default=1000, help='optimize iterations')
    parser.add_argument('--noise-regularize', type=float, default=100000.0, help='weight of the noise regularization')
    parser.add_argument('--mse', type=float, default=0, help='weight of the mse loss')
    parser.add_argument('--n-mean-latent', type=int, default=10000, help='sampling times to obtain the mean latent')
    parser.add_argument('--w-plus', action='store_true', help='allow to use distinct latent codes to each layers')
    args = parser.parse_args()
    return args