Commit cf45df20 by “liusq”

车牌高低开销远程配置

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