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