otx.cli.utils.parser#
Utils for parsing command line arguments.
Functions
|
Adds hyper parameters sub parser. |
|
Generates help for hyper parameters section. |
|
Generates hyper parameters dict from parsed command line arguments. |
|
Get override param list from params. |
A function to distinguish between when there is template input and when there is no template input. |
|
|
If input type is string, convert it to boolean. |
Classes
|
Parser add on to parse memory size string. |
|
Text Help Formatter that shortens. |
- class otx.cli.utils.parser.MemSizeAction(option_strings, dest, nargs=None, **kwargs)[source]#
Bases:
Action
Parser add on to parse memory size string.
- class otx.cli.utils.parser.ShortDefaultsHelpFormatter(prog, indent_increment=2, max_help_position=24, width=None)[source]#
Bases:
RawTextHelpFormatter
Text Help Formatter that shortens.
- otx.cli.utils.parser.add_hyper_parameters_sub_parser(parser, config, modes=None, return_sub_parser=False) ArgumentParser | None [source]#
Adds hyper parameters sub parser.
- otx.cli.utils.parser.gen_param_help(hyper_parameters: Dict) Dict [source]#
Generates help for hyper parameters section.
- otx.cli.utils.parser.gen_params_dict_from_args(args, override_param: List | None = None, type_hint: dict | None = None) Dict[str, dict] [source]#
Generates hyper parameters dict from parsed command line arguments.
- otx.cli.utils.parser.get_parser_and_hprams_data()[source]#
A function to distinguish between when there is template input and when there is no template input.
Inspect the template using pre_parser to get the template’s hyper_parameters information. Finally, it returns the parser used in the actual main.