| 76 | |
| 77 | |
| 78 | def parse_args(): |
| 79 | parser = argparse.ArgumentParser(description="training script of dense label vae.") |
| 80 | parser.add_argument( |
| 81 | "--dataset_name", |
| 82 | type=str, |
| 83 | default="ade20k_semantic", |
| 84 | help="The name of the dataset to use for training.", |
| 85 | ) |
| 86 | parser.add_argument( |
| 87 | "--label_column", |
| 88 | type=str, |
| 89 | default="semantic", |
| 90 | help="The column name of the label in the dataset.", |
| 91 | ) |
| 92 | parser.add_argument( |
| 93 | "--lightweight_label_vae", |
| 94 | action="store_true", |
| 95 | help="Whether or not to use lightweight vae.", |
| 96 | ) |
| 97 | parser.add_argument( |
| 98 | "--loss_type", |
| 99 | type=str, |
| 100 | default="ce", |
| 101 | choices=['ce', 'seg'], |
| 102 | help="The type of loss to use for training.", |
| 103 | ) |
| 104 | parser.add_argument( |
| 105 | "--output_dir", |
| 106 | type=str, |
| 107 | default=None, |
| 108 | help="The output directory where the model predictions and checkpoints will be written.", |
| 109 | ) |
| 110 | parser.add_argument( |
| 111 | "--seed", |
| 112 | type=int, |
| 113 | default=42, |
| 114 | help="A seed for reproducible training." |
| 115 | ) |
| 116 | parser.add_argument( |
| 117 | "--resolution", |
| 118 | type=int, |
| 119 | default=512, |
| 120 | help="The resolution for input images, all the images in the train/validation dataset will be resized to this" |
| 121 | " resolution", |
| 122 | ) |
| 123 | parser.add_argument( |
| 124 | "--train_batch_size", |
| 125 | type=int, |
| 126 | default=16, |
| 127 | help="Batch size (per device) for the training dataloader." |
| 128 | ) |
| 129 | parser.add_argument( |
| 130 | "--num_train_epochs", |
| 131 | type=int, |
| 132 | default=100 |
| 133 | ) |
| 134 | parser.add_argument( |
| 135 | "--max_train_steps", |