• argparse模块


    import argparse
    
    def parse_args() -> argparse.Namespace:
        """Parse and return command line arguments"""
        parser = argparse.ArgumentParser(add_help=False)
        args = parser.add_argument_group('Options')
        # fmt: off
        args.add_argument('-h', '--help', action='help', help='Show this help message and exit.')
        args.add_argument('-m', '--model', required=True, type=str,
                          help='Required. Path to an .xml or .onnx file with a trained model.')
        args.add_argument('-i', '--input', required=True, type=str, help='Required. Path to an image file.')
        args.add_argument('-l', '--extension', type=str, default=None,
                          help='Optional. Required by the CPU Plugin for executing the custom operation on a CPU. '
                          'Absolute path to a shared library with the kernels implementations.')
        args.add_argument('-c', '--config', type=str, default=None,
                          help='Optional. Required by GPU or VPU Plugins for the custom operation kernel. '
                          'Absolute path to operation description file (.xml).')
        args.add_argument('-d', '--device', default='CPU', type=str,
                          help='Optional. Specify the target device to infer on; CPU, GPU, MYRIAD, HDDL or HETERO: '
                               'is acceptable. The sample will look for a suitable plugin for device specified. '
                               'Default value is CPU.')
        args.add_argument('--labels', default=None, type=str, help='Optional. Path to a labels mapping file.')
        # fmt: on
        return parser.parse_args()
    if __name__ == '__main__':
        args = parse_args()
        print(args.model)
    
  • 相关阅读:
    CFS 调度器
    RCU
    linux cfs 负载均衡
    wait_event_interruptible_timeout
    算法(13)Contiguous Array
    算法(12)Pascal's Triangle II
    算法(12)Best Time to Buy and Sell Stock II
    算法(11)Find All Duplicates in an Array
    算法(10)Subarray Sum Equals K
    算法(9)Find the Duplicate Number
  • 原文地址:https://www.cnblogs.com/wuyuan2011woaini/p/16017911.html
Copyright © 2020-2023  润新知