Python配合yolov11开发对象检测软件

  1. 上编文件写了yolov11开发分类,写篇文章写开发对象检测软件
  2. 环境配置onnx 1.16.1,onnx-graphsurgeon 0.5.2,onnxruntime 1.19.2,onnxruntime-gpu 1.19.2,onnxslim 0.1.34,torch 2.3.1+cu121,torchaudio 2.3.1+cu121,torchvision 0.18.1+cu121,PySide6 6.6.1,PySide6-Addons 6.6.1,PySide6-Essentials 6.6.1
  3. 分类使用的数据集,halcon的pill_bag对象检测的数据集
    4.软件界面



5.关键代码

bash 复制代码
 image_mat_ = self.CoverQImageToMat()
            results_=self.Model.predict(image_mat_)
            for result_ in  results_:
                boxes_ = result_.boxes
                # names_=results_.names
                for box_ in boxes_:
                    x_,y_,w_,h_=box_.xywh[0]
                    c=box_.cls
                    cls_=self.Model.names[int(c)]
                    self.BoxX.append(float(x_))
                    self.BoxY.append(float(y_))
                    self.BoxWidth.append(float(w_))
                    self.BoxHeight.append(float(h_))
                    self.BoxClass.append(cls_)
bash 复制代码
  ###运行推理
            # outputs=self.OnnxModel.run(["output0"],{"images":image_np_})
            outputs = self.OnnxModel.run([output_onnx_.name], {input_onnx_.name: image_np_})
            len(outputs)
            # print("OutputShape:", outputs.shape)
            ###outputs处理
            output_onnx_ = outputs[0][0]
            print("OutputOnxxShape:", output_onnx_.shape)

            ###转换 行列
            output_onnx_ = output_onnx_.transpose()
            print("OutputOnxxShape:", output_onnx_.shape)
            row = output_onnx_[0]
            print(row)  ###输出下第一个特征

6.推理效果

相关推荐
曹牧6 分钟前
Java:处理 HTTP 请求的 Content-Type
java·开发语言
AI技术增长8 分钟前
Pytorch图像去噪实战(八):Noise2Void盲点网络图像去噪实战,只有单张带噪图也能训练
人工智能·pytorch·python
才兄说13 分钟前
机器人二次开发机器狗巡检?路径覆盖率100%
python
隔壁大炮19 分钟前
Day07-RNN层(循环网络层)
人工智能·pytorch·python·rnn·深度学习·神经网络·计算机视觉
itzixiao20 分钟前
L1-066 猫是液体(5分)[java][python]
java·开发语言·python·算法
zhoutongsheng23 分钟前
如何解决ORA-01078参数文件错误_pfile与spfile互相创建恢复
jvm·数据库·python
Lightning-py27 分钟前
Python 配置日志(Logging)
开发语言·python
2401_8242226927 分钟前
HTML怎么标注字数限制提示_HTML实时字数统计占位【详解】
jvm·数据库·python
隔窗听雨眠32 分钟前
MySQL主从延迟根因诊断法
开发语言·php
Hui_AI72037 分钟前
基于RAG的农产品GEO溯源智能问答系统实现
开发语言·网络·人工智能·python·算法·创业创新