Safemotion Lib
Loading...
Searching...
No Matches
smdetect
runner
mmdet_pytorch_runner.py
Go to the documentation of this file.
1
from
mmdet.apis
import
init_detector, inference_detector
2
3
class
MMDetPyTorchRunner
(object):
4
"""
5
mmdetection의 모델을 동작시키기 위한 클래스
6
args:
7
model_cfg (str): mmdetection의 모델이 정의된 config파일 경로
8
model_checkpoint (str): 모델의 파라미터가 저장된 파일 경로
9
device (str): 모델이 구동될 디바이스
10
"""
11
def
__init__
(self, model_cfg, model_checkpoint, device='cuda'):
12
13
self.
model
= init_detector(model_cfg, model_checkpoint, device=device)
14
15
def
run_detector
(self, image):
16
"""
17
객체 검출기를 동작시키는 기능
18
args:
19
image (np.ndarray): RGB 이미지
20
"""
21
22
result = inference_detector(self.
model
, image)
23
24
return
result
mmdet_pytorch_runner.MMDetPyTorchRunner
Definition
mmdet_pytorch_runner.py:3
mmdet_pytorch_runner.MMDetPyTorchRunner.__init__
__init__(self, model_cfg, model_checkpoint, device='cuda')
Definition
mmdet_pytorch_runner.py:11
mmdet_pytorch_runner.MMDetPyTorchRunner.model
model
Definition
mmdet_pytorch_runner.py:13
mmdet_pytorch_runner.MMDetPyTorchRunner.run_detector
run_detector(self, image)
Definition
mmdet_pytorch_runner.py:15
Generated by
1.10.0