Safemotion Lib
Loading...
Searching...
No Matches
runner_builder.py
Go to the documentation of this file.
1from smpose.runner.mmpose_trt_runner import MMPoseTRTRunner
2
3
4__runner_builders__ = {
5 "MMPoseTRTRunner": MMPoseTRTRunner,
6}
7
9 """
10 pose/runner 의 모델을 빌드하는 함수
11 현재 pose/runner의 모델은 mmpose기반으로 구현되어 있음
12 TODO: pytorch 모델 빌드하는 기능 추가 필요
13
14 args :
15 type -> 모델의 타입 __runner_builders__ 의 키값이 들어가야함
16 type을 제외한 나머지 파라미터는 모델의 파라미터값이 있어야함
17 세부적으로 모듈의 타입과 모듈의 파라미터가 정의되어 있어야함
18
19 returns:
20 파이토이 모델 or TensorRT 모델
21 """
22 assert args.type in __runner_builders__, \
23 f'not found pose model type : {args.type}'
24
25 runner_builder = __runner_builders__[args.type]
26 runner_args = args.copy()
27 runner_args.pop('type')
28 return runner_builder(**runner_args)
build_pose_runner(args)