| 17 | |
| 18 | |
| 19 | def parse_args(): |
| 20 | parser = argparse.ArgumentParser(description='Train a GAN network') |
| 21 | parser.add_argument('--cfg', dest='cfg_file', |
| 22 | help='optional config file', |
| 23 | default=None, type=str) |
| 24 | parser.add_argument('--gpu', dest='gpu_id', |
| 25 | help='GPU device id to use [0]', |
| 26 | default=-1, type=int) |
| 27 | parser.add_argument('--caption_path', type=str, default=None, |
| 28 | help='Path to the file with text sentences') |
| 29 | # if len(sys.argv) == 1: |
| 30 | # parser.print_help() |
| 31 | # sys.exit(1) |
| 32 | args = parser.parse_args() |
| 33 | return args |
| 34 | |
| 35 | |
| 36 | def sample_encoded_context(embeddings, model, bAugmentation=True): |