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