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

1600-900
Jeffrey_Li 2 years ago
parent 5b66880fc9
commit f421a7ca7d

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

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

@ -279,7 +279,7 @@ Cigarette::Cigarette(QWidget *parent)
{ {
if(SingleCamInfo[i].Detect){ if(SingleCamInfo[i].Detect){
cam_status_mat[i]->setStyleSheet(tr("background-color: rgb(0, 170, 0);")); 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); QMessageBox::information(NULL, QStringLiteral("系统自检失败"), QStringLiteral("AI模型1初始化失败请检查程序完整性"), QMessageBox::Ok);
exit(-1); exit(-1);
@ -288,7 +288,7 @@ Cigarette::Cigarette(QWidget *parent)
} }
} }
#ifdef __DEBUG #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 #endif
//自动打开所有相机 //自动打开所有相机
if (g_sys_conf.auto_open == 1) if (g_sys_conf.auto_open == 1)
@ -2028,7 +2028,7 @@ bool Cigarette::read_sys_config(SysConf &conf)
} }
else if (tmp_key == "MODELPATH") 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") else if (tmp_key == "JPGPATH")
{ {

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

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

Loading…
Cancel
Save