Commit cf45df20 by “liusq”

车牌高低开销远程配置

parent 93324592
......@@ -50,9 +50,9 @@ void AlgorithmTaskManage::initHumanDetectionManage(const QString &modelPaths,
}
}
void AlgorithmTaskManage::initLicensePlateManage(const QString &modelPaths,
float carConfidence){
float carConfidence,bool is_high){
for (int i = 0; i < licensePlateLen; ++i) {
LicensePlateRecognition* licensePlateRecognition=new LicensePlateRecognition(modelPaths,carConfidence);
LicensePlateRecognition* licensePlateRecognition=new LicensePlateRecognition(modelPaths,carConfidence,is_high);
licensePlateRecognitions.emplace_back(licensePlateRecognition);
}
......@@ -103,7 +103,8 @@ void AlgorithmTaskManage::releaseResources(
std::map<QString,QString>& faceMaps,
int numberFaces,
float faceConfidence,
__uint8_t algorithmPermissions) {
__uint8_t algorithmPermissions,
bool is_high) {
Common & instance = Common::getInstance();
isShuttingDown.store(true, std::memory_order_release);
......@@ -129,7 +130,7 @@ void AlgorithmTaskManage::releaseResources(
if ((algorithmPermissions & 0x01) != 0) {
resetSemaphoreAndClearObjects(instance,plateSemaphore, licensePlateRecognitions, licensePlateLen);
initialize(newHumanDetectionLen, newLicensePlateLen, newFaceLen, false, 0x01);
initLicensePlateManage(odelPaths, licensePlateCarConfidence);
initLicensePlateManage(odelPaths, licensePlateCarConfidence,is_high);
}
}
......
......@@ -29,7 +29,7 @@ public:
float carShapeConfidence,int &uniformColor);
void initLicensePlateManage(const QString &modelPaths,
float carConfidence);
float carConfidence,bool is_high);
void modifyImageFeature(std::map<QString,QString>&maps,int numberFaces,float confidence,bool isNull);
void initFaceReconitionHandle(std::map<QString,QString>&maps,int numberFaces,float confidence);
......@@ -44,7 +44,7 @@ public:
std::map<QString,QString>& faceMaps,
int numberFaces,
float faceConfidence,
__uint8_t algorithmPermissions);
__uint8_t algorithmPermissions,bool is_high);
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -4,14 +4,18 @@
LicensePlateRecognition::LicensePlateRecognition(const QString &modelPaths, float carConfidence) {
LicensePlateRecognition::LicensePlateRecognition(const QString &modelPaths, float carConfidence,bool is_high) {
HLPR_ContextConfiguration configuration = {0};
QByteArray && by_mpath=modelPaths.toUtf8();
char* m_path=by_mpath.data();
configuration.models_path = m_path;
configuration.max_num = 5;
if(is_high){
configuration.det_level = DETECT_LEVEL_HIGH;
}else{
configuration.det_level = DETECT_LEVEL_LOW;
}
configuration.use_half = false;
configuration.nms_threshold = 0.5f;
configuration.rec_confidence_threshold = carConfidence;
......
......@@ -29,7 +29,7 @@ public:
void replaceWith1And0( QString &code);
LicensePlateRecognition(const QString &modelPaths,float carConfidence);
LicensePlateRecognition(const QString &modelPaths,float carConfidence,bool is_high);
LicensePlateRecognition();
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -263,6 +263,7 @@ struct LicensePlateConfig {
float carConfidenceMin;
int licensePlateLen;
quint64 updateAt;
bool is_high;
};
......
......@@ -71,11 +71,12 @@ MainWindow::MainWindow()
float carShapeConfidence=config.uniformConfig.carShapeConfidence;
float carConfidence=config.licensePlateConfig.carConfidence;
bool is_high=config.licensePlateConfig.is_high;
AlgorithmTaskManage &algorithmTaskManage= AlgorithmTaskManage::getInstance();
algorithmTaskManage.initialize(humanDetectionLen,licensePlateLen,faceLen,true,0x00);
algorithmTaskManage.initHumanDetectionManage(modelPaths,carShapeConfidence,uniformColor);
algorithmTaskManage.initLicensePlateManage(modelPaths,carConfidence);
algorithmTaskManage.initLicensePlateManage(modelPaths,carConfidence,is_high);
MediaFaceImage* mediaFaceImage= MediaFaceImage::getInstance();
QString configPath = qSetting->value("devices/sz_config_path").toString();
......@@ -154,13 +155,14 @@ void MainWindow::divParameterUpdate(vides_data::responseConfig &cloudConfig ){
if(!faceAlgorithm && !licensePlateAlgorithm && !uniformAlgorithm && !timeChange){
return;
}
bool is_high=cloudConfig.licensePlateConfig.is_high;
__uint8_t alg= this->intToUint8t(faceAlgorithm,licensePlateAlgorithm,uniformAlgorithm) ;
algorithmTaskManage.releaseResources(cloudConfig.uniformConfig.humanDetectionLen
,cloudConfig.licensePlateConfig.licensePlateLen,
cloudConfig.faceConfig.faceLen,modelPaths,
cloudConfig.uniformConfig.carShapeConfidence
,cloudConfig.uniformConfig.uniformColor,cloudConfig.licensePlateConfig.carConfidence,localImageMap,cloudConfig.faceConfig.faceNumbers,cloudConfig.faceConfig.confidence,alg);
,cloudConfig.uniformConfig.uniformColor,cloudConfig.licensePlateConfig.carConfidence,localImageMap,
cloudConfig.faceConfig.faceNumbers,cloudConfig.faceConfig.confidence,alg,is_high);
if(config.timerSettings.updateAt!=cloudConfig.timerSettings.updateAt){
if(config.timerSettings.deleteLogFileTimer!=cloudConfig.timerSettings.deleteLogFileTimer){
deleteLogFileTimer->stop();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment