| 14 | |
| 15 | |
| 16 | def parse_args(): |
| 17 | parser = argparse.ArgumentParser(description='Train a detector') |
| 18 | parser.add_argument('config', help='train config file path') |
| 19 | parser.add_argument( |
| 20 | '--shape', |
| 21 | type=int, |
| 22 | nargs='+', |
| 23 | default=[1024, 1024], |
| 24 | help='input image size') |
| 25 | parser.add_argument( |
| 26 | '--cfg-options', |
| 27 | nargs='+', |
| 28 | action=DictAction, |
| 29 | help='override some settings in the used config, the key-value pair ' |
| 30 | 'in xxx=yyy format will be merged into config file. If the value to ' |
| 31 | 'be overwritten is a list, it should be like key="[a,b]" or key=a,b ' |
| 32 | 'It also allows nested list/tuple values, e.g. key="[(a,b),(c,d)]" ' |
| 33 | 'Note that the quotation marks are necessary and that no white space ' |
| 34 | 'is allowed.') |
| 35 | parser.add_argument( |
| 36 | '--size-divisor', |
| 37 | type=int, |
| 38 | default=32, |
| 39 | help='Pad the input image, the minimum size that is divisible ' |
| 40 | 'by size_divisor, -1 means do not pad the image.') |
| 41 | args = parser.parse_args() |
| 42 | return args |
| 43 | |
| 44 | |
| 45 | def main(): |