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

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;
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 = "../model/jd.names";
@ -28,8 +28,8 @@ bool AlgJd::init(QString model_path, QString jpg_path)
cv::String modelConfiguration = "../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 = "../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;
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("alg_jd.jpg");

@ -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);

@ -279,7 +279,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);
@ -288,7 +288,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)
@ -2028,7 +2028,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")
{

@ -76,7 +76,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]; //相机曝光时间,单位微秒
@ -89,8 +89,6 @@ public:
int MonitorPort;
int FeedbackPort;
int FilePort;
QString model_path;
QString jpg_path;
//MonitorPort为数据端口
//MonitorPort+NumberOfSupportedCameras为图像端口
//MonitorPort+NumberOfSupportedCameras*2为发送命令端口,也就是FeedbackPort
@ -109,7 +107,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配置文件中
}
}
}
@ -352,7 +352,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