| 40 | |
| 41 | |
| 42 | def args(sub_parser: _SubParsersAction): |
| 43 | sub_parser.add_argument( |
| 44 | '--seed', dest='seed', |
| 45 | default=42, type=int, |
| 46 | help="Set the random seed: Default = 42") |
| 47 | sub_parser.add_argument( |
| 48 | '--config', dest='config', |
| 49 | default='config.yaml', type=str, |
| 50 | help="Set configuration file path: Default = 'config.yaml'") |
| 51 | sub_parser.add_argument( |
| 52 | '--root', dest='root', |
| 53 | default='./../', type=str, |
| 54 | help="Set root path of project that parents all others: Default = './../'") |
| 55 | sub_parser.add_argument( |
| 56 | '--data', dest='data', |
| 57 | default='data', type=str, |
| 58 | help="Set data directory path: Default = 'data'") |
| 59 | sub_parser.add_argument( |
| 60 | '--output', dest='output', |
| 61 | default='logs', type=str, |
| 62 | help="Set output directory path: Default = 'logs'") |
| 63 | sub_parser.add_argument( |
| 64 | '--checkpoint', dest='checkpoint', |
| 65 | default='checkpoint', type=str, |
| 66 | help="Set checkpoint directory path: Default = 'checkpoint'") |
| 67 | sub_parser.add_argument( |
| 68 | '--resume', dest='resume', |
| 69 | default=None, type=str, |
| 70 | help="Set checkpoint resume path: Default = None") |
| 71 | sub_parser.add_argument( |
| 72 | '--save-freq', default=25, type=int, |
| 73 | help='Checkpoint epoch save frequency: Default = 25') |
| 74 | sub_parser.add_argument( |
| 75 | '--cpu', action='store_true', |
| 76 | dest='cpu', |
| 77 | help="Flag: CPU bound training: Default = False") |
| 78 | sub_parser.set_defaults(cpu=False) |
| 79 | sub_parser.add_argument( |
| 80 | '--dist', action='store_true', |
| 81 | dest='dist', |
| 82 | help="Distributed training: Default = False") |
| 83 | sub_parser.set_defaults(dist=False) |
| 84 | sub_parser.add_argument( |
| 85 | '--pretrained', action='store_true', |
| 86 | dest='pretrained', |
| 87 | help="Pretrained weights for (Resnet50, Resnet101, DenseNet121, MobileNetV3): Default = False") |
| 88 | |
| 89 | |
| 90 | class TrainingAgent: |