| 5 | |
| 6 | |
| 7 | def parse_arguments(): |
| 8 | import argparse |
| 9 | import ast |
| 10 | parser = argparse.ArgumentParser() |
| 11 | parser.add_argument( |
| 12 | "--model_dir", required=True, help="Path of PaddleDetection model.") |
| 13 | parser.add_argument( |
| 14 | "--image_file", type=str, required=True, help="Path of test image file.") |
| 15 | parser.add_argument( |
| 16 | "--device", |
| 17 | type=str, |
| 18 | default='cpu', |
| 19 | help="Type of inference device, support, 'cpu' or 'gpu'.") |
| 20 | parser.add_argument( |
| 21 | "--use_trt", |
| 22 | type=ast.literal_eval, |
| 23 | default=False, |
| 24 | help="Wether to use tensorrt.") |
| 25 | return parser.parse_args() |
| 26 | |
| 27 | |
| 28 | def build_option(args): |