Safemotion Lib
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
yolov8_runner.YoloV8Runner Class Reference
Inheritance diagram for yolov8_runner.YoloV8Runner:

Public Member Functions

 __init__ (self, checkpoint, **kwargs)
 
 run_detector (self, image)
 

Public Attributes

 model
 
 kwargs
 

Detailed Description

YOLO 모델을 동작시키기 위한 클래스
args:
    checkpoint (str): 모델 파라미터 저장 경로, engine 파일(TensorRT 모델) 또는 pt 파일(torch 모델)
    kwargs (str): 모델 동작을 위한 기타 파라미터

Definition at line 3 of file yolov8_runner.py.

Constructor & Destructor Documentation

◆ __init__()

yolov8_runner.YoloV8Runner.__init__ ( self,
checkpoint,
** kwargs )

Definition at line 10 of file yolov8_runner.py.

10 def __init__(self, checkpoint, **kwargs):
11 self.model = YOLO(checkpoint)
12 self.kwargs = kwargs
13

Member Function Documentation

◆ run_detector()

yolov8_runner.YoloV8Runner.run_detector ( self,
image )
객체 검출기를 동작시키는 기능
args:
    image (np.ndarray): RGB? BGR? 이미지

Definition at line 14 of file yolov8_runner.py.

14 def run_detector(self, image):
15 """
16 객체 검출기를 동작시키는 기능
17 args:
18 image (np.ndarray): RGB? BGR? 이미지
19 """
20
21 results = self.model.predict(source=image, **self.kwargs)
22
23 data = {}
24 data['det_bboxes'] = results[0].boxes.data.cpu()[:, :5]
25 data['det_labels'] = results[0].boxes.cls.cpu()
26
27 return data
28

Member Data Documentation

◆ kwargs

yolov8_runner.YoloV8Runner.kwargs

Definition at line 12 of file yolov8_runner.py.

◆ model

yolov8_runner.YoloV8Runner.model

Definition at line 11 of file yolov8_runner.py.


The documentation for this class was generated from the following file: