有几个参数名字重复,修改一下

main
Jeffrey_Li 2 years ago
parent 228e781876
commit a6da5c3b77

@ -22,7 +22,7 @@ static int inpHeight = 416; // Height of network's input image
static std::vector<std::string> classes;
bool AlgJd::init(QString model_path, QString jpg_path)
bool AlgJd::init(QString path_model, QString path_jpg)
{
// Load names of classes
std::string classesFile = "D:/model/jd.names";
@ -31,8 +31,8 @@ bool AlgJd::init(QString model_path, QString jpg_path)
cv::String modelConfiguration = "D:/model/jd.cfg";
cv::String modelWeights;
if (model_path.length() > 0) {
modelWeights = model_path.toStdString();
if (path_model.length() > 0) {
modelWeights = path_model.toStdString();
}
else {
modelWeights = "D:/model/jd.weights";
@ -57,8 +57,8 @@ bool AlgJd::init(QString model_path, QString jpg_path)
//cv::Mat image = cv::imread("alg_jd.jpg");
cv::Mat image;
if (jpg_path.length() > 0) {
image = cv::imread(jpg_path.toStdString());
if (path_jpg.length() > 0) {
image = cv::imread(path_jpg.toStdString());
}
else {
image = cv::imread("D:/Release/alg_jd.bmp");

@ -12,7 +12,7 @@
class AlgJd
{
public:
bool init(QString model_path, QString jpg_path);
bool init(QString path_model, QString path_jpg);
bool test_detect();
bool test_detect_batcht(int shoot);
int detect(cv::Mat& in, cv::Mat &out, std::vector<std::pair<int, cv::Rect> > &results);

@ -289,7 +289,7 @@ Cigarette::Cigarette(QWidget *parent)
{
if(SingleCamInfo[i].Detect){
cam_status_mat[i]->setStyleSheet(tr("background-color: rgb(0, 170, 0);"));
if (!alg_jd[i].init(g_sys_conf.model_path,g_sys_conf.jpg_path))
if (!alg_jd[i].init(g_sys_conf.path_model,g_sys_conf.path_jpg))
{
QMessageBox::information(NULL, QStringLiteral("系统自检失败"), QStringLiteral("AI模型1初始化失败请检查程序完整性"), QMessageBox::Ok);
exit(-1);
@ -298,7 +298,7 @@ Cigarette::Cigarette(QWidget *parent)
}
}
#ifdef __DEBUG
alg_test.init(g_sys_conf.model_path,g_sys_conf.jpg_path);
alg_test.init(g_sys_conf.path_model,g_sys_conf.path_jpg);
#endif
//自动打开所有相机
if (g_sys_conf.auto_open == 1)
@ -2049,7 +2049,7 @@ bool Cigarette::read_sys_config(SysConf &conf)
}
else if (tmp_key == "MODELPATH")
{
conf.path = line.substr(pos + 1).c_str();
conf.path_model = line.substr(pos + 1).c_str();
}
else if (tmp_key == "JPGPATH")
{

@ -74,7 +74,7 @@ public:
QTime shiftB; //B换班时间
QTime shiftC; //C换班时间
QString location; // 所在地
QString path; // Ä£ÐÍ·¾¶
QString path_model; // Ä£ÐÍ·¾¶
QString path_jpg; // 图片路径
int timing_shift; //是否定时换班0否1是
int expo[NumberOfSupportedCameras]; //相机曝光时间,单位微秒
@ -87,8 +87,6 @@ public:
int MonitorPort;
int FeedbackPort;
int FilePort;
QString model_path;
QString jpg_path;
//MonitorPort为数据端口
//MonitorPort+NumberOfSupportedCameras为图像端口
//MonitorPort+NumberOfSupportedCameras*2为发送命令端口,也就是FeedbackPort
@ -108,7 +106,7 @@ public:
shift_byhand = 1;
timing_shift=0; //是否定时换班0否1是
location = "";
path = "";
path_model = "";
path_jpg = "";
shiftA.setHMS(0, 0, 0);
shiftB.setHMS(0, 0, 0);

@ -261,7 +261,7 @@ void DialogSetup::on_toolButton_choose_path_released() {
else {
if (ui.comboBox->findText(WeightsPath) == -1) {
ui.comboBox->addItem(WeightsPath); // 在comboBox中显示文件路径
g_sys_conf.path = WeightsPath; // 将选择的路径写入conf配置文件中
g_sys_conf.path_model = WeightsPath; // 将选择的路径写入conf配置文件中
}
}
}
@ -358,7 +358,7 @@ void DialogSetup::write_config()
sprintf(buf, "LOCATION=%s\n", g_sys_conf.location.toStdString().c_str());
cfg_file.write(buf, strlen(buf));
memset(buf, 0, 256);
sprintf(buf, "MODELPATH=%s\n", g_sys_conf.path.toStdString().c_str());
sprintf(buf, "MODELPATH=%s\n", g_sys_conf.path_model.toStdString().c_str());
cfg_file.write(buf, strlen(buf));
memset(buf, 0, 256);
sprintf(buf, "JPGPATH=%s\n", g_sys_conf.path_jpg.toStdString().c_str());

Loading…
Cancel
Save