MCPcopy Create free account
hub / github.com/PaddlePaddle/PaddleDetection / build_option

Function build_option

deploy/fastdeploy/cpu-gpu/python/infer.py:28–43  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

26
27
28def build_option(args):
29 option = fd.RuntimeOption()
30
31 if args.device.lower() == "gpu":
32 option.use_gpu()
33
34 if args.use_trt:
35 option.use_paddle_infer_backend()
36 # If use original Tensorrt, not Paddle-TensorRT,
37 # please try `option.use_trt_backend()`
38 option.paddle_infer_option.enable_trt = True
39 option.paddle_infer_option.collect_trt_shape = True
40 option.trt_option.set_shape("image", [1, 3, 640, 640], [1, 3, 640, 640],
41 [1, 3, 640, 640])
42 option.trt_option.set_shape("scale_factor", [1, 2], [1, 2], [1, 2])
43 return option
44
45
46args = parse_arguments()

Callers 1

infer.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected