YOLOv8.py 347 B

123456789101112
  1. from ultralytics import YOLO
  2. class YOLOv8MFDModel(object):
  3. def __init__(self, weight, device='cpu'):
  4. self.mfd_model = YOLO(weight)
  5. self.device = device
  6. def predict(self, image):
  7. mfd_res = self.mfd_model.predict(image, imgsz=1888, conf=0.25, iou=0.45, verbose=True, device=self.device)[0]
  8. return mfd_res