网站域名备案流程,广告做到百度第一页,django电影网站开发,Wordpress始于最近在做一个深度学习对图片中对象识别效果的检测工具#xff0c;其主要功能就是将自己标注的图片与识别结果图片进行对比然后计算识别的准确等参数#xff0c;并提供原图与结果图片的显示功能。脚本主要完成识别与计算功能#xff0c;QT完成数据的整理显示与图片的显示。我…最近在做一个深度学习对图片中对象识别效果的检测工具其主要功能就是将自己标注的图片与识别结果图片进行对比然后计算识别的准确等参数并提供原图与结果图片的显示功能。脚本主要完成识别与计算功能QT完成数据的整理显示与图片的显示。我们可以直接用qt的QProcess调用bash来执行运行脚本的命令获取结果数据则有两种方式一是在python脚本中将结果写到文本中脚本结束后由qt读取。二是在脚本中用print按一定格式将结果输出在Qt中可用QProcess的信号槽机制获取输出结果。void TagDetection::startDetect_slot(){p new QProcess(this);//当脚本中的结果全部(注意是全部)print完成后进入到OnReadData_slotconnect(p, SIGNAL(readyReadStandardOutput()), this, SLOT(OnReadData_slot()));//组合命令带入参QString labelsStr QString::fromStdString(m_Vecmodels.at(m_CurrentLabel).types).split( ).join(/);QStringList cmdList;cmdList:fromstdstring:fromstdstring:fromstdstring:fromstdstring:fromstdstring:fromstdstring:fromstdstring:fromstdstring:fromstdstring:fromstdstring:fromstdstringQString cmd cmdList.join( );qDebug()//开始执行p-start(cmd);//等待提示框QApplication::setOverrideCursor(Qt::WaitCursor);//设置鼠标为等待状态QProgressDialog progress;progress.setWindowTitle(codecMain-toUnicode(提示));progress.setLabelText(codecMain-toUnicode(正在检测中...));progress.setCancelButton(false);progress.setRange(0, 60000);//设置范围progress.setModal(true);//设置为模态对话框progress.show();for (int i 0; i 3000 ; i){QThread::msleep(100);QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);progress.setValue(i);//进入槽函数则停止等待if(g_IsDetectedDone){g_IsDetectedDone false;break;}//用户取消的话则中止if (progress.wasCanceled()){break;}}QApplication::restoreOverrideCursor();progress.close();QMessageBox::warning(this, codecMain-toUnicode(提示), codecMain-toUnicode(检测结束));}槽函数如下//识别完成void TagDetection::OnReadData_slot(){//改变标志位停止等待g_IsDetectedDone true;//获取结果QString Pyresult codecMain-toUnicode(p-readAllStandardOutput());qDebug()ui.textEdit-setText(Pyresult);//关闭bashp-kill();p-close();delete p;//数据处理...//或者读取识别结果文本QFile file(result.txt);QStringList result;if (file.open(QIODevice::ReadOnly | QIODevice::Text)){while (!file.atEnd()){//按行读取QByteArray line file.readLine();QString str(line);result.append(str);qDebug() str;}file.close();}//数据处理...}