MCPcopy Index your code
hub / github.com/PaddlePaddle/PaddleDetection / argsparser

Function argsparser

deploy/python/utils.py:22–221  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20
21
22def argsparser():
23 parser = argparse.ArgumentParser(description=__doc__)
24 parser.add_argument(
25 "--model_dir",
26 type=str,
27 default=None,
28 help=("Directory include:'model.pdiparams', 'model.pdmodel', "
29 "'infer_cfg.yml', created by tools/export_model.py."),
30 required=True)
31 parser.add_argument(
32 "--image_file", type=str, default=None, help="Path of image file.")
33 parser.add_argument(
34 "--image_dir",
35 type=str,
36 default=None,
37 help="Dir of image file, `image_file` has a higher priority.")
38 parser.add_argument(
39 "--batch_size", type=int, default=1, help="batch_size for inference.")
40 parser.add_argument(
41 "--video_file",
42 type=str,
43 default=None,
44 help="Path of video file, `video_file` or `camera_id` has a highest priority."
45 )
46 parser.add_argument(
47 "--camera_id",
48 type=int,
49 default=-1,
50 help="device id of camera to predict.")
51 parser.add_argument(
52 "--threshold", type=float, default=0.5, help="Threshold of score.")
53 parser.add_argument(
54 "--output_dir",
55 type=str,
56 default="output",
57 help="Directory of output visualization files.")
58 parser.add_argument(
59 "--run_mode",
60 type=str,
61 default='paddle',
62 help="mode of running(paddle/trt_fp32/trt_fp16/trt_int8)")
63 parser.add_argument(
64 "--device",
65 type=str,
66 default='cpu',
67 help="Choose the device you want to run, it can be: CPU/GPU/XPU/NPU, default is CPU."
68 )
69 parser.add_argument(
70 "--use_gpu",
71 type=ast.literal_eval,
72 default=False,
73 help="Deprecated, please use `--device`.")
74 parser.add_argument(
75 "--run_benchmark",
76 type=ast.literal_eval,
77 default=False,
78 help="Whether to predict a image_file repeatedly for benchmark")
79 parser.add_argument(

Callers 5

keypoint_infer.pyFile · 0.90
infer.pyFile · 0.90
mot_jde_infer.pyFile · 0.90
mot_sde_infer.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected