def parse_args():
    parser = argparse.ArgumentParser(description='OpenSelfSup extract features of a model')
    parser.add_argument('config', help='test config file path')
    parser.add_argument('--checkpoint', default=None, help='checkpoint file')
    parser.add_argument('--pretrained', default='random', help='pretrained model file, exclusive to --checkpoint')
    parser.add_argument('--dataset-config', default='benchmarks/extract_info/voc07.py', help='extract dataset config file path')
    parser.add_argument('--layer-ind', type=str, help='layer indices, separated by comma, e.g., "0,1,2,3,4"')
    parser.add_argument('--work_dir', type=str, default=None, help='the dir to save logs and models')
    parser.add_argument('--launcher', choices=['none', 'pytorch', 'slurm', 'mpi'], default='none', help='job launcher')
    parser.add_argument('--local_rank', type=int, default=0)
    parser.add_argument('--port', type=int, default=29500, help='port only works when launcher=="slurm"')
    args = parser.parse_args()
    if ('LOCAL_RANK' not in os.environ):
        os.environ['LOCAL_RANK'] = str(args.local_rank)
    return args
def parse_args():
    parser = argparse.ArgumentParser(description='OpenSelfSup extract features of a model')
    parser.add_argument('config', help='test config file path')
    parser.add_argument('--checkpoint', default=None, help='checkpoint file')
    parser.add_argument('--pretrained', default='random', help='pretrained model file, exclusive to --checkpoint')
    parser.add_argument('--dataset-config', default='benchmarks/extract_info/voc07.py', help='extract dataset config file path')
    parser.add_argument('--layer-ind', type=str, help='layer indices, separated by comma, e.g., "0,1,2,3,4"')
    parser.add_argument('--work_dir', type=str, default=None, help='the dir to save logs and models')
    parser.add_argument('--launcher', choices=['none', 'pytorch', 'slurm', 'mpi'], default='none', help='job launcher')
    parser.add_argument('--local_rank', type=int, default=0)
    parser.add_argument('--port', type=int, default=29500, help='port only works when launcher=="slurm"')
    args = parser.parse_args()
    if ('LOCAL_RANK' not in os.environ):
        os.environ['LOCAL_RANK'] = str(args.local_rank)
    return args