如何获取model.predict()方法的结果

问题描述 投票:0回答:1

我有一段用于分割细胞的模型的代码片段:

model = YOLO(FileModelPath)
predictions = model.predict(img, show = False, classes=[0,1], save = True,project='YourPhoto' ,name=Ui_MainWindow.FILENAME, show_labels = False, show_conf = False,save_txt = True, conf=float(text), line_thickness=1)

工作完成后,该方法将数据输出到控制台:

0: 640x640 7 Explode cells, 78 Whole cells, 402.8ms

Speed: 4.9ms preprocess, 402.8ms inference, 161.3ms postprocess per image at shape (1, 3, 640, 640)

问题是,我如何在代码中获取这些数据?这样我就可以在我的图形用户界面中输出它们?

yolo predict pyqt6
1个回答
0
投票

仅使用:

打印(预测[0].速度)

示例输出

{'预处理': 0.0, '推理': 25.67434310913086, '后处理': 6.798505783081055}

© www.soinside.com 2019 - 2024. All rights reserved.