|
@@ -19,7 +19,8 @@ class YOLOv8:
|
|
return self.detect_objects(image)
|
|
return self.detect_objects(image)
|
|
|
|
|
|
def initialize_model(self, path):
|
|
def initialize_model(self, path):
|
|
- self.session = onnxruntime.InferenceSession(path,providers=['CUDAExecutionProvider','CPUExecutionProvider'])
|
|
|
|
|
|
+ # 'CUDAExecutionProvider',
|
|
|
|
+ self.session = onnxruntime.InferenceSession(path, providers=['CPUExecutionProvider'])
|
|
# Get model info
|
|
# Get model info
|
|
self.get_input_details()
|
|
self.get_input_details()
|
|
self.get_output_details()
|
|
self.get_output_details()
|
|
@@ -185,7 +186,8 @@ class YOLOv8:
|
|
return y
|
|
return y
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if __name__ == "__main__":
|
|
|
|
+ model_path = "/Volumes/Media/WorkDoc/Beizhi/CODE/hyd-yolo/models/water_strean_model.pt"
|
|
yolov8_detector = YOLOv8(model_path, conf_thres=0.7, iou_thres=0.7)
|
|
yolov8_detector = YOLOv8(model_path, conf_thres=0.7, iou_thres=0.7)
|
|
- image = cv2.imread()
|
|
|
|
|
|
+ image = cv2.imread("/Users/zhenqin/temp/yolo_demo/datasets/hyd-action/images/Frame2000128.png")
|
|
boxes, scores, class_ids = yolov8_detector(image)
|
|
boxes, scores, class_ids = yolov8_detector(image)
|
|
print(boxes, scores, class_ids)
|
|
print(boxes, scores, class_ids)
|