Fix model extract race issue to all classes
This commit is contained in:
@@ -55,6 +55,15 @@ namespace ANSCENTER {
|
||||
ANS_DBG("FaceRecognizer", "ANSFRBase::Initialize FAILED");
|
||||
return false;
|
||||
}
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSFR::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSFR::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
#ifdef CPU_MODE
|
||||
engineType = EngineType::CPU;
|
||||
ANS_DBG("FaceRecognizer", "CPU_MODE forced: engineType=CPU");
|
||||
@@ -199,6 +208,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSFRBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSFaceRecognizer::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSFaceRecognizer::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (engineType == EngineType::NVIDIA_GPU) {
|
||||
std::string onnxfile = CreateFilePath(_modelFolder, "ansfacerecognizer.onnx");
|
||||
|
||||
@@ -9,6 +9,15 @@ namespace ANSCENTER {
|
||||
std::string& labelMap) {
|
||||
bool result = ANSFRBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ArcFace::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ArcFace::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
_modelConfig = modelConfig;
|
||||
@@ -71,6 +80,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSFRBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ArcFace::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ArcFace::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string onnxfile50 = CreateFilePath(_modelFolder, "ansfacerecognizer50.onnx");
|
||||
if (std::filesystem::exists(onnxfile50)) {
|
||||
|
||||
@@ -20,6 +20,15 @@ namespace ANSCENTER {
|
||||
{
|
||||
bool result = ANSFRBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSFaceNet::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSFaceNet::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.modelType = ModelType::FACERECOGNIZE;
|
||||
@@ -65,6 +74,15 @@ namespace ANSCENTER {
|
||||
// We need to get the _modelFolder
|
||||
bool result = ANSFRBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSFaceNet::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSFaceNet::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// We need to get the modelfolder from here
|
||||
std::string faceidModel = CreateFilePath(_modelFolder, "ansfacenet.xml");
|
||||
if (std::filesystem::exists(faceidModel)) {
|
||||
|
||||
@@ -518,6 +518,15 @@ namespace ANSCENTER {
|
||||
this->_logger.LogError("ANSFDBase::Initialize. Output model folder is not exist", _modelFolder, __FILE__, __LINE__);
|
||||
return false; // That means the model file is not exist or the password is not correct
|
||||
}
|
||||
// Serialize init against concurrent extract re-entries on the same
|
||||
// folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSALPR::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSALPR::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
|
||||
@@ -304,6 +304,15 @@ namespace ANSCENTER {
|
||||
this->_logger.LogError("ANSALPR_CPU::Initialize. Output model folder is not exist", _modelFolder, __FILE__, __LINE__);
|
||||
return false; // That means the model file is not exist or the password is not correct
|
||||
}
|
||||
// Serialize init against concurrent extract re-entries on the same
|
||||
// folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSALPR_CPU::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSALPR_CPU::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 3. Load LD model
|
||||
alprChecker.Init(MAX_ALPR_FRAME);
|
||||
@@ -317,6 +326,15 @@ namespace ANSCENTER {
|
||||
bool ANSALPR_CPU::LoadEngine() {
|
||||
std::lock_guard<std::recursive_mutex> lock(_mutex);
|
||||
try {
|
||||
// Serialize init against concurrent extract re-entries on the same
|
||||
// folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSALPR_CPU::LoadEngine");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSALPR_CPU::LoadEngine",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// 1. Load license plate detection model (using CPU OpenVINO)
|
||||
if (_lprDetector) _lprDetector.reset();
|
||||
std::string lprModel = CreateFilePath(_modelFolder, "lprModel.xml");
|
||||
|
||||
@@ -177,6 +177,15 @@ namespace ANSCENTER
|
||||
this->_logger.LogError("ANSALPR_OCR::Initialize", "Output model folder does not exist: " + _modelFolder, __FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Serialize init against concurrent extract re-entries on the same
|
||||
// folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSALPR_OCR::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSALPR_OCR::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check country from country.txt
|
||||
std::string countryFile = CreateFilePath(_modelFolder, "country.txt");
|
||||
@@ -216,6 +225,15 @@ namespace ANSCENTER
|
||||
bool ANSALPR_OCR::LoadEngine() {
|
||||
std::lock_guard<std::recursive_mutex> lock(_mutex);
|
||||
try {
|
||||
// Serialize init against concurrent extract re-entries on the same
|
||||
// folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSALPR_OCR::LoadEngine");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSALPR_OCR::LoadEngine",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
WriteEventLog("ANSALPR_OCR::LoadEngine: Step 1 - Starting engine load");
|
||||
this->_logger.LogInfo("ANSALPR_OCR::LoadEngine", "Step 1: Starting engine load", __FILE__, __LINE__);
|
||||
|
||||
|
||||
@@ -431,6 +431,15 @@ namespace ANSCENTER {
|
||||
this->_logger.LogError("ANSALPR_OD::Initialize. Output model folder is not exist", _modelFolder, __FILE__, __LINE__);
|
||||
return false; // That means the model file is not exist or the password is not correct
|
||||
}
|
||||
// Serialize init against concurrent extract re-entries on the same
|
||||
// folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSALPR_OD::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSALPR_OD::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check country
|
||||
std::string countryFile = CreateFilePath(_modelFolder, "country.txt");
|
||||
@@ -509,6 +518,15 @@ namespace ANSCENTER {
|
||||
bool ANSALPR_OD::LoadEngine() {
|
||||
std::lock_guard<std::recursive_mutex> lock(_mutex);
|
||||
try {
|
||||
// Serialize init against concurrent extract re-entries on the same
|
||||
// folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSALPR_OD::LoadEngine");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSALPR_OD::LoadEngine",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
WriteEventLog("ANSALPR_OD::LoadEngine: Step 1 - Starting engine load");
|
||||
this->_logger.LogInfo("ANSALPR_OD::LoadEngine", "Step 1: Starting engine load", __FILE__, __LINE__);
|
||||
|
||||
|
||||
@@ -13,6 +13,15 @@ namespace ANSCENTER {
|
||||
{
|
||||
bool result = ANSOCRBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, engineMode);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSCPUOCR::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSCPUOCR::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
//Override the paddleocrv3 for openvino only
|
||||
switch (_modelConfig.ocrLanguage) {
|
||||
|
||||
@@ -9,6 +9,15 @@ namespace ANSCENTER {
|
||||
{
|
||||
bool result = ANSOCRBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, engineMode);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSOCR::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOCR::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
auto option = fastdeploy::RuntimeOption();
|
||||
// Add default values to modelConfig if required.
|
||||
_modelConfig.precisionType = "fp32";
|
||||
|
||||
@@ -96,6 +96,15 @@ namespace ANSCENTER {
|
||||
this->_logger.LogError("ANSOCRBase::Initialize. Output model folder is not exist", modelName, __FILE__, __LINE__);
|
||||
return false; // That means the model file is not exist or the password is not correct
|
||||
}
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSOCRBase::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOCRBase::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -149,6 +158,15 @@ namespace ANSCENTER {
|
||||
this->_logger.LogError("ANSOCRBase::Initialize. Output model folder is not exist", modelName, __FILE__, __LINE__);
|
||||
return false; // That means the model file is not exist or the password is not correct
|
||||
}
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSOCRBase::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOCRBase::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// 3. Check if the model has the configuration file
|
||||
std::string modelConfigName = "model_config.json";
|
||||
_modelConfigFile = CreateFilePath(_modelFolder, modelConfigName);
|
||||
|
||||
@@ -9,6 +9,15 @@ bool ANSONNXOCR::Initialize(const std::string& licenseKey, OCRModelConfig modelC
|
||||
try {
|
||||
bool result = ANSOCRBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, engineMode);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSONNXOCR::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXOCR::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Validate detection model
|
||||
if (!FileExist(_modelConfig.detectionModelFile)) {
|
||||
|
||||
@@ -9,6 +9,15 @@ bool ANSRTOCR::Initialize(const std::string& licenseKey, OCRModelConfig modelCon
|
||||
try {
|
||||
bool result = ANSOCRBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, engineMode);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in Utility.h.
|
||||
ANSCENTER::ModelFolderLockGuard _flg(_modelFolder, "ANSRTOCR::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSRTOCR::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Validate detection model
|
||||
if (!FileExist(_modelConfig.detectionModelFile)) {
|
||||
|
||||
@@ -33,6 +33,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSANOMALIB::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSANOMALIB::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_device = "AUTO:GPU,CPU";
|
||||
_openvinoPreprocess = true;
|
||||
_efficientAd = false;
|
||||
@@ -91,6 +100,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSANOMALIB::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSANOMALIB::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "model";
|
||||
@@ -167,6 +185,15 @@ namespace ANSCENTER {
|
||||
//this->_logger.LogDebug("ANSANOMALIB::Initialize. OpenVINO version", openVINOVersion, __FILE__, __LINE__);
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSANOMALIB::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSANOMALIB::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for ABNORMAL only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::SEGMENTATION;
|
||||
|
||||
@@ -38,6 +38,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSCUSTOMDETECTOR::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSCUSTOMDETECTOR::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string labelMap;
|
||||
CreateCustomDetector();
|
||||
//_customDetector->SetLoadEngineOnCreate(this->_loadEngineOnCreation);
|
||||
@@ -248,6 +257,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSCUSTOMDETECTOR::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSCUSTOMDETECTOR::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig = modelConfig;
|
||||
if (_modelConfig.modelMNSThreshold < 0.2)
|
||||
_modelConfig.modelMNSThreshold = 0.5;
|
||||
|
||||
@@ -343,6 +343,15 @@ if sys.stderr is None or not hasattr(sys.stderr, "write"):
|
||||
// Step 1: Base model init
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSCUSTOMPY::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSCUSTOMPY::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.inpHeight = 640;
|
||||
|
||||
@@ -26,6 +26,12 @@
|
||||
#define DEBUG_PRINT(x) std::cout << x << std::endl;
|
||||
//#define DEBUGENGINE
|
||||
//#define USE_TV_MODEL // Use model to detect if person is on TV screen or not
|
||||
|
||||
// NOTE: ANSCENTER::ModelFolderLockGuard has been moved to Utility.h so that
|
||||
// non-ANSODEngine modules (ANSOCR, ANSLPR, ANSFR, ...) can use it without
|
||||
// pulling in ANSODEngine headers. It remains available here transitively
|
||||
// because this file #includes "Utility.h" above.
|
||||
|
||||
const int MAX_HISTORY_FACE = 5;
|
||||
const int MAX_MISSING_FACE = 30;
|
||||
const int MAX_TRACKS = 200;
|
||||
|
||||
@@ -62,13 +62,22 @@ namespace ANSCENTER
|
||||
size_t vectorSize = passwordArray.size();
|
||||
for (size_t i = 0; i < vectorSize; i++) {
|
||||
if (ExtractPasswordProtectedZip(modelZipFilePath, passwordArray[i], modelName, _modelFolder, false))
|
||||
break; // Break the loop when the condition is met.
|
||||
break; // Break the loop when the condition is met.
|
||||
}
|
||||
// 2. Check if the outputFolder exist
|
||||
if (!std::filesystem::exists(_modelFolder)) {
|
||||
this->_logger.LogError("ANSFDBase::LoadModel. Output model folder is not exist", _modelFolder, __FILE__, __LINE__);
|
||||
return false; // That means the model file is not exist or the password is not correct
|
||||
}
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSFDBase::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSFDBase::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// 3. Check if the model has the configuration file
|
||||
std::string modelConfigName = "model_config.json";
|
||||
_modelConfigFile = CreateFilePath(_modelFolder, modelConfigName);
|
||||
@@ -160,6 +169,15 @@ namespace ANSCENTER
|
||||
this->_logger.LogError("ANSFDBase::Initialize. Output model folder does not exist", _modelFolder, __FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSFDBase::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSFDBase::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfigFile = CreateFilePath(_modelFolder, "model_config.json");
|
||||
|
||||
// 4. Load the image processing model
|
||||
|
||||
@@ -57,13 +57,22 @@ namespace ANSCENTER
|
||||
size_t vectorSize = passwordArray.size();
|
||||
for (size_t i = 0; i < vectorSize; i++) {
|
||||
if (ExtractPasswordProtectedZip(modelZipFilePath, passwordArray[i], modelName, _modelFolder, false))
|
||||
break; // Break the loop when the condition is met.
|
||||
break; // Break the loop when the condition is met.
|
||||
}
|
||||
// 2. Check if the outputFolder exist
|
||||
if (!std::filesystem::exists(_modelFolder)) {
|
||||
this->_logger.LogError("ANSFRBase::LoadModel. Output model folder is not exist", _modelFolder, __FILE__, __LINE__);
|
||||
return false; // That means the model file is not exist or the password is not correct
|
||||
}
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSFRBase::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSFRBase::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// 3. Check if the model has the configuration file
|
||||
std::string modelConfigName = "model_config.json";
|
||||
_modelConfigFile = CreateFilePath(_modelFolder, modelConfigName);
|
||||
@@ -105,13 +114,22 @@ namespace ANSCENTER
|
||||
size_t vectorSize = passwordArray.size();
|
||||
for (size_t i = 0; i < vectorSize; i++) {
|
||||
if (ExtractPasswordProtectedZip(modelZipFilePath, passwordArray[i], modelName, _modelFolder, false))
|
||||
break; // Break the loop when the condition is met.
|
||||
break; // Break the loop when the condition is met.
|
||||
}
|
||||
// 2. Check if the outputFolder exist
|
||||
if (!std::filesystem::exists(_modelFolder)) {
|
||||
this->_logger.LogError("ANSFRBase::Initialize. Output model folder is not exist", _modelFolder, __FILE__, __LINE__);
|
||||
return false; // That means the model file is not exist or the password is not correct
|
||||
}
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSFRBase::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSFRBase::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// 3. Check if the model has the configuration file
|
||||
std::string modelConfigName = "model_config.json";
|
||||
_modelConfigFile = CreateFilePath(_modelFolder, modelConfigName);
|
||||
|
||||
@@ -1953,6 +1953,15 @@ namespace ANSCENTER {
|
||||
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSMOTIONDETECTOR::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSMOTIONDETECTOR::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_isInitialized = true;
|
||||
//_modelConfig.detectionScoreThreshold = 0.5;
|
||||
labelMap = "Movement";
|
||||
@@ -1968,6 +1977,15 @@ namespace ANSCENTER {
|
||||
bool ANSMOTIONDETECTOR::LoadModelFromFolder(std::string licenseKey, ModelConfig modelConfig, std::string modelName, std::string className, const std::string& modelFolder, std::string& labelMap) {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSMOTIONDETECTOR::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSMOTIONDETECTOR::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_isInitialized = true;
|
||||
labelMap = "Movement";
|
||||
return true;
|
||||
|
||||
@@ -25,6 +25,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ODHUBAPI::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ODHUBAPI::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// 0. Check weigth file
|
||||
std::string weightfile = CreateFilePath(_modelFolder, "train_last.weights");
|
||||
if (FileExist(weightfile)) {
|
||||
@@ -82,6 +91,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ODHUBAPI::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ODHUBAPI::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "train_last";
|
||||
@@ -154,6 +172,15 @@ namespace ANSCENTER
|
||||
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ODHUBAPI::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ODHUBAPI::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
|
||||
@@ -882,6 +882,15 @@ namespace ANSCENTER
|
||||
_modelLoadValid = false;
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXCL::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXCL::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::CLASSIFICATION;
|
||||
@@ -943,6 +952,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXCL::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXCL::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::CLASSIFICATION;
|
||||
_modelConfig.modelType = ModelType::TENSORRT;
|
||||
_modelConfig.inpHeight = 224;
|
||||
@@ -999,6 +1017,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXCL::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXCL::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "train_last";
|
||||
|
||||
@@ -1377,6 +1377,15 @@ namespace ANSCENTER {
|
||||
_modelLoadValid = false;
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXOBB::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXOBB::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
@@ -1438,6 +1447,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXOBB::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXOBB::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::CLASSIFICATION;
|
||||
_modelConfig.modelType = ModelType::TENSORRT;
|
||||
_modelConfig.inpHeight = 640;
|
||||
@@ -1494,6 +1512,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXOBB::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXOBB::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "train_last";
|
||||
|
||||
@@ -1267,6 +1267,15 @@ namespace ANSCENTER {
|
||||
_modelLoadValid = false;
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXPOSE::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXPOSE::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
@@ -1329,6 +1338,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXPOSE::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXPOSE::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::CLASSIFICATION;
|
||||
_modelConfig.modelType = ModelType::TENSORRT;
|
||||
_modelConfig.inpHeight = 640;
|
||||
@@ -1386,6 +1404,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXPOSE::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXPOSE::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "train_last";
|
||||
|
||||
@@ -42,6 +42,15 @@ namespace ANSCENTER
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig,
|
||||
modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXSAM3::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXSAM3::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
_modelConfig.detectionType = DetectionType::SEGMENTATION;
|
||||
if (_modelConfig.modelConfThreshold < 0.1f)
|
||||
@@ -89,6 +98,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXSAM3::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXSAM3::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
_modelConfig.detectionType = DetectionType::SEGMENTATION;
|
||||
if (_modelConfig.modelConfThreshold < 0.1f)
|
||||
@@ -138,6 +156,15 @@ namespace ANSCENTER
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig,
|
||||
modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXSAM3::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXSAM3::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = DetectionType::SEGMENTATION;
|
||||
|
||||
@@ -1158,6 +1158,15 @@ namespace ANSCENTER {
|
||||
_modelLoadValid = false;
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXSEG::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXSEG::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::SEGMENTATION;
|
||||
@@ -1220,6 +1229,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXSEG::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXSEG::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::SEGMENTATION;
|
||||
_modelConfig.modelType = ModelType::ONNXSEG;
|
||||
_modelConfig.inpHeight = 640;
|
||||
@@ -1277,6 +1295,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXSEG::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSONNXSEG::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "train_last";
|
||||
|
||||
@@ -1775,53 +1775,21 @@ namespace ANSCENTER {
|
||||
labelMap = VectorToCommaSeparatedString(_classes);
|
||||
|
||||
if (this->_loadEngineOnCreation) {
|
||||
// Hold the model-folder lock across session creation so a
|
||||
// concurrent CreateANSODHandle on the same model cannot
|
||||
// re-enter ExtractProtectedZipFile and truncate the .onnx
|
||||
// file while ORT is opening it (which would surface as
|
||||
// "system error number 13" EACCES from the ORT loader).
|
||||
//
|
||||
// Timed wait — 120s ceiling for extract + ORT session
|
||||
// creation (GPU EP compile can take ~30s on large models).
|
||||
// If we hit the timeout, the peer thread is deadlocked or
|
||||
// wedged; fail the load instead of hanging the caller.
|
||||
auto _folderLock = GetModelFolderLock(_modelFolder);
|
||||
std::unique_lock<std::timed_mutex> _folderGuard(
|
||||
*_folderLock, std::defer_lock);
|
||||
ANS_DBG("ONNXYOLO", "Initialize: waiting on folder lock (120s): %s",
|
||||
_modelFolder.c_str());
|
||||
auto _lockT0 = std::chrono::steady_clock::now();
|
||||
if (!_folderGuard.try_lock_for(std::chrono::seconds(120))) {
|
||||
auto waitedMs = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - _lockT0).count();
|
||||
ANS_DBG("ONNXYOLO",
|
||||
"Initialize: TIMEOUT on folder lock after %lldms: %s",
|
||||
(long long)waitedMs, _modelFolder.c_str());
|
||||
// Serialize session creation against concurrent extract re-entries
|
||||
// on the same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXYOLO::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
_logger.LogError("ANSONNXYOLO::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
auto waitedMs = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - _lockT0).count();
|
||||
ANS_DBG("ONNXYOLO", "Initialize: folder lock acquired in %lldms, calling InitOrtEngine",
|
||||
(long long)waitedMs);
|
||||
auto _initT0 = std::chrono::steady_clock::now();
|
||||
if (!InitOrtEngine()) {
|
||||
auto initMs = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - _initT0).count();
|
||||
ANS_DBG("ONNXYOLO",
|
||||
"Initialize: InitOrtEngine FAILED after %lldms, model=%s",
|
||||
(long long)initMs, _modelFilePath.c_str());
|
||||
_logger.LogError("ANSONNXYOLO::Initialize",
|
||||
"Failed to create ONNX Runtime engine: " + _modelFilePath,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
auto initMs = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - _initT0).count();
|
||||
ANS_DBG("ONNXYOLO", "Initialize: InitOrtEngine OK in %lldms",
|
||||
(long long)initMs);
|
||||
}
|
||||
|
||||
// Fix input resolution for dynamic-shape models.
|
||||
@@ -1886,45 +1854,16 @@ namespace ANSCENTER {
|
||||
}
|
||||
|
||||
if (this->_loadEngineOnCreation) {
|
||||
// See ANSONNXYOLO::Initialize — hold folder lock so a sibling
|
||||
// extraction cannot truncate train_last.onnx mid-load. Timed
|
||||
// wait so a stuck peer cannot hang this thread forever.
|
||||
auto _folderLock = GetModelFolderLock(_modelFolder);
|
||||
std::unique_lock<std::timed_mutex> _folderGuard(
|
||||
*_folderLock, std::defer_lock);
|
||||
ANS_DBG("ONNXYOLO", "LoadModel: waiting on folder lock (120s): %s",
|
||||
_modelFolder.c_str());
|
||||
auto _lockT0 = std::chrono::steady_clock::now();
|
||||
if (!_folderGuard.try_lock_for(std::chrono::seconds(120))) {
|
||||
auto waitedMs = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - _lockT0).count();
|
||||
ANS_DBG("ONNXYOLO",
|
||||
"LoadModel: TIMEOUT on folder lock after %lldms: %s",
|
||||
(long long)waitedMs, _modelFolder.c_str());
|
||||
// See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXYOLO::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
_logger.LogError("ANSONNXYOLO::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
_modelLoadValid = false;
|
||||
return false;
|
||||
}
|
||||
auto waitedMs = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - _lockT0).count();
|
||||
ANS_DBG("ONNXYOLO", "LoadModel: folder lock acquired in %lldms, calling InitOrtEngine",
|
||||
(long long)waitedMs);
|
||||
auto _initT0 = std::chrono::steady_clock::now();
|
||||
if (!InitOrtEngine()) {
|
||||
auto initMs = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - _initT0).count();
|
||||
ANS_DBG("ONNXYOLO",
|
||||
"LoadModel: InitOrtEngine FAILED after %lldms, model=%s",
|
||||
(long long)initMs, _modelFilePath.c_str());
|
||||
_modelLoadValid = false;
|
||||
return false;
|
||||
}
|
||||
auto initMs = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - _initT0).count();
|
||||
ANS_DBG("ONNXYOLO", "LoadModel: InitOrtEngine OK in %lldms",
|
||||
(long long)initMs);
|
||||
if (!InitOrtEngine()) { _modelLoadValid = false; return false; }
|
||||
}
|
||||
|
||||
// Fix input resolution for dynamic-shape models (same as primary Initialize)
|
||||
@@ -1999,45 +1938,16 @@ namespace ANSCENTER {
|
||||
labelMap = VectorToCommaSeparatedString(_classes);
|
||||
|
||||
if (this->_loadEngineOnCreation) {
|
||||
// See ANSONNXYOLO::Initialize — hold folder lock so a sibling
|
||||
// extraction cannot truncate the model file mid-load. Timed
|
||||
// wait so a stuck peer cannot hang this thread forever.
|
||||
auto _folderLock = GetModelFolderLock(_modelFolder);
|
||||
std::unique_lock<std::timed_mutex> _folderGuard(
|
||||
*_folderLock, std::defer_lock);
|
||||
ANS_DBG("ONNXYOLO", "LoadModelFromFolder: waiting on folder lock (120s): %s",
|
||||
_modelFolder.c_str());
|
||||
auto _lockT0 = std::chrono::steady_clock::now();
|
||||
if (!_folderGuard.try_lock_for(std::chrono::seconds(120))) {
|
||||
auto waitedMs = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - _lockT0).count();
|
||||
ANS_DBG("ONNXYOLO",
|
||||
"LoadModelFromFolder: TIMEOUT on folder lock after %lldms: %s",
|
||||
(long long)waitedMs, _modelFolder.c_str());
|
||||
// See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSONNXYOLO::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
_logger.LogError("ANSONNXYOLO::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
_modelLoadValid = false;
|
||||
return false;
|
||||
}
|
||||
auto waitedMs = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - _lockT0).count();
|
||||
ANS_DBG("ONNXYOLO", "LoadModelFromFolder: folder lock acquired in %lldms, calling InitOrtEngine",
|
||||
(long long)waitedMs);
|
||||
auto _initT0 = std::chrono::steady_clock::now();
|
||||
if (!InitOrtEngine()) {
|
||||
auto initMs = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - _initT0).count();
|
||||
ANS_DBG("ONNXYOLO",
|
||||
"LoadModelFromFolder: InitOrtEngine FAILED after %lldms, model=%s",
|
||||
(long long)initMs, _modelFilePath.c_str());
|
||||
_modelLoadValid = false;
|
||||
return false;
|
||||
}
|
||||
auto initMs = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - _initT0).count();
|
||||
ANS_DBG("ONNXYOLO", "LoadModelFromFolder: InitOrtEngine OK in %lldms",
|
||||
(long long)initMs);
|
||||
if (!InitOrtEngine()) { _modelLoadValid = false; return false; }
|
||||
}
|
||||
|
||||
// Fix input resolution for dynamic-shape models (same as primary Initialize)
|
||||
|
||||
@@ -36,6 +36,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "OPENVINOCL::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("OPENVINOCL::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// 0. Check if the configuration file exist
|
||||
if (FileExist(_modelConfigFile)) {
|
||||
ModelType modelType;
|
||||
@@ -84,6 +93,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "OPENVINOCL::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("OPENVINOCL::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "train_last";
|
||||
@@ -182,6 +200,15 @@ namespace ANSCENTER
|
||||
//this->_logger.LogDebug("OPENVINOCL::Initialize. OpenVINO version", openVINOVersion, __FILE__, __LINE__);
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "OPENVINOCL::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("OPENVINOCL::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::CLASSIFICATION;
|
||||
|
||||
@@ -36,6 +36,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "OPENVINOOD::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("OPENVINOOD::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// 0. Check if the configuration file exist
|
||||
if (FileExist(_modelConfigFile)) {
|
||||
ModelType modelType;
|
||||
@@ -85,6 +94,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "OPENVINOOD::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("OPENVINOOD::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "train_last";
|
||||
@@ -187,6 +205,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "OPENVINOOD::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("OPENVINOOD::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
|
||||
@@ -7,8 +7,17 @@
|
||||
namespace ANSCENTER {
|
||||
bool ANSOVFBFD::Initialize(std::string licenseKey, ModelConfig modelConfig, const std::string& modelZipFilePath, const std::string& modelZipPassword, std::string& labelMap) {
|
||||
bool result = ANSFDBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSOVFBFD::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOVFBFD::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
labelMap = "Face";
|
||||
// We do not need to check for the license
|
||||
// We do not need to check for the license
|
||||
_licenseValid = true;
|
||||
if (!_licenseValid) return false;
|
||||
try {
|
||||
@@ -70,6 +79,15 @@ namespace ANSCENTER {
|
||||
// We need to get the _modelFolder
|
||||
bool result = ANSFDBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSOVFBFD::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOVFBFD::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// We need to get the modelfolder from here
|
||||
std::string xmlfile = CreateFilePath(_modelFolder, "ansovfb.xml");
|
||||
if (std::filesystem::exists(xmlfile)) {
|
||||
|
||||
@@ -11,6 +11,15 @@
|
||||
namespace ANSCENTER {
|
||||
bool ANSOVFD::Initialize(std::string licenseKey, ModelConfig modelConfig, const std::string& modelZipFilePath, const std::string& modelZipPassword, std::string& labelMap) {
|
||||
bool result = ANSFDBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSOVFD::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOVFD::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
labelMap = "Face";
|
||||
_licenseValid = true;
|
||||
std::vector<std::string> labels{ labelMap };
|
||||
@@ -47,6 +56,15 @@ namespace ANSCENTER {
|
||||
// We need to get the _modelFolder
|
||||
bool result = ANSFDBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSOVFD::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOVFD::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string onnxModel = CreateFilePath(_modelFolder, "scrfd.onnx");
|
||||
//this->_face_detector = std::make_unique<SCRFD>(onnxModel);
|
||||
_isInitialized = true;
|
||||
@@ -62,6 +80,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSFDBase::LoadModelFromFolder(licenseKey, modelConfig,modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSOVFD::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOVFD::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "scrfd";
|
||||
|
||||
@@ -34,6 +34,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSOVSEG::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOVSEG::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// 0. Check if the configuration file exist
|
||||
if (FileExist(_modelConfigFile)) {
|
||||
ModelType modelType;
|
||||
@@ -83,6 +92,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSOVSEG::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOVSEG::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "train_last";
|
||||
@@ -152,6 +170,15 @@ namespace ANSCENTER {
|
||||
this->_logger.LogDebug("ANSOVSEG::Initialize. OpenVINO version", openVINOVersion, __FILE__, __LINE__);
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSOVSEG::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOVSEG::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::SEGMENTATION;
|
||||
|
||||
@@ -37,6 +37,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSPOSE::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSPOSE::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_device = GetOpenVINODevice(_core);
|
||||
// 0. Check if the configuration file exist
|
||||
if (FileExist(_modelConfigFile)) {
|
||||
@@ -81,6 +90,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSPOSE::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSPOSE::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "ansposesetimation";
|
||||
@@ -145,6 +163,15 @@ namespace ANSCENTER {
|
||||
this->_logger.LogDebug("ANSPOSE::Initialize. OpenVINO version", openVINOVersion, __FILE__, __LINE__);
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSPOSE::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSPOSE::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for ABNORMAL only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::KEYPOINT;
|
||||
|
||||
@@ -63,6 +63,15 @@ namespace ANSCENTER {
|
||||
_isFixedBatch = false;
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSRTYOLO::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSRTYOLO::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
_modelConfig.modelType = ModelType::TENSORRT;
|
||||
if (_modelConfig.inpHeight <= 0) _modelConfig.inpHeight = 640;
|
||||
@@ -155,6 +164,15 @@ namespace ANSCENTER {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig,
|
||||
modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSRTYOLO::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSRTYOLO::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.modelType = ModelType::TENSORRT;
|
||||
@@ -260,6 +278,15 @@ namespace ANSCENTER {
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig,
|
||||
modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSRTYOLO::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSRTYOLO::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.modelType = ModelType::TENSORRT;
|
||||
|
||||
@@ -39,6 +39,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSSAM::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSSAM::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string xmlfile = CreateFilePath(_modelFolder, "anssam.xml");
|
||||
std::string binaryfile = CreateFilePath(_modelFolder, "anssam.bin");
|
||||
if (std::filesystem::exists(xmlfile)) {
|
||||
@@ -72,6 +81,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSSAM::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSSAM::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "anssam";
|
||||
@@ -114,6 +132,15 @@ namespace ANSCENTER {
|
||||
_modelConfig = modelConfig;
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSSAM::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSSAM::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string xmlfile = CreateFilePath(_modelFolder, "anssam.xml");
|
||||
std::string binaryfile = CreateFilePath(_modelFolder, "anssam.bin");
|
||||
if (std::filesystem::exists(xmlfile)) {
|
||||
|
||||
@@ -691,6 +691,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSSAM3::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSSAM3::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
_modelConfig.detectionType = DetectionType::SEGMENTATION;
|
||||
if (_modelConfig.modelConfThreshold < 0.1f)
|
||||
@@ -751,6 +760,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSSAM3::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSSAM3::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
_modelConfig.detectionType = DetectionType::SEGMENTATION;
|
||||
if (_modelConfig.modelConfThreshold < 0.1f)
|
||||
@@ -809,6 +827,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSSAM3::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSSAM3::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = DetectionType::SEGMENTATION;
|
||||
|
||||
@@ -62,6 +62,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "TENSORRTCL::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("TENSORRTCL::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::CLASSIFICATION;
|
||||
_modelConfig.modelType = ModelType::TENSORRT;
|
||||
_modelConfig.inpHeight = 224;
|
||||
@@ -157,6 +166,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "TENSORRTCL::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("TENSORRTCL::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "train_last";
|
||||
@@ -263,6 +281,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "TENSORRTCL::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("TENSORRTCL::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::CLASSIFICATION;
|
||||
|
||||
@@ -59,6 +59,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSTENSORRTPOSE::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSTENSORRTPOSE::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
_modelConfig.modelType = ModelType::TENSORRT;
|
||||
_modelConfig.inpHeight = 640;
|
||||
@@ -150,6 +159,15 @@ namespace ANSCENTER
|
||||
{
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSTENSORRTPOSE::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSTENSORRTPOSE::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
_modelConfig.modelType = ModelType::RTPOSE;
|
||||
@@ -253,6 +271,15 @@ namespace ANSCENTER
|
||||
_modelLoadValid = false;
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSTENSORRTPOSE::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSTENSORRTPOSE::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
|
||||
@@ -59,6 +59,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "TENSORRTSEG::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("TENSORRTSEG::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::SEGMENTATION;
|
||||
_modelConfig.modelType = ModelType::RTSEG;
|
||||
_modelConfig.inpHeight = 640;
|
||||
@@ -150,6 +159,15 @@ namespace ANSCENTER
|
||||
{
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "TENSORRTSEG::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("TENSORRTSEG::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::SEGMENTATION;
|
||||
_modelConfig.modelType = ModelType::RTSEG;
|
||||
@@ -253,6 +271,15 @@ namespace ANSCENTER
|
||||
_modelLoadValid = false;
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "TENSORRTSEG::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("TENSORRTSEG::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::SEGMENTATION;
|
||||
|
||||
@@ -63,6 +63,15 @@ namespace ANSCENTER
|
||||
_isFixedBatch = false;
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "TENSORRTOD::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("TENSORRTOD::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
_modelConfig.modelType = ModelType::TENSORRT;
|
||||
_modelConfig.inpHeight = 640;
|
||||
@@ -158,6 +167,15 @@ namespace ANSCENTER
|
||||
_isFixedBatch = false;
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "TENSORRTOD::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("TENSORRTOD::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
_modelConfig.modelType = ModelType::TENSORRT;
|
||||
@@ -265,6 +283,15 @@ namespace ANSCENTER
|
||||
_isFixedBatch = false;
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "TENSORRTOD::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("TENSORRTOD::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
|
||||
@@ -28,6 +28,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "YOLO12OD::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("YOLO12OD::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
_modelConfig.inpHeight = 640;
|
||||
_modelConfig.inpWidth = 640;
|
||||
@@ -87,6 +96,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className,modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "YOLO12OD::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("YOLO12OD::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "train_last";
|
||||
@@ -160,6 +178,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "YOLO12OD::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("YOLO12OD::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
|
||||
@@ -949,6 +949,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "YOLOOD::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("YOLOOD::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
_modelConfig.inpHeight = 640;
|
||||
_modelConfig.inpWidth = 640;
|
||||
@@ -1042,6 +1051,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "YOLOOD::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("YOLOOD::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "train_last";
|
||||
@@ -1165,6 +1183,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "YOLOOD::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("YOLOOD::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
|
||||
@@ -37,6 +37,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSOYOLOV10OVOD::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOYOLOV10OVOD::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
_modelConfig.modelType = ModelType::OPENVINO;
|
||||
_modelConfig.inpHeight = 640;
|
||||
@@ -93,6 +102,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig,modelName, className,modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSOYOLOV10OVOD::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOYOLOV10OVOD::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "train_last";
|
||||
@@ -166,6 +184,15 @@ namespace ANSCENTER
|
||||
//this->_logger.LogDebug("ANSOYOLOV10OVOD::Initialize. OpenVINO version", openVINOVersion, __FILE__, __LINE__);
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSOYOLOV10OVOD::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOYOLOV10OVOD::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
|
||||
@@ -60,6 +60,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSYOLOV10RTOD::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSYOLOV10RTOD::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
_modelConfig.modelType = ModelType::TENSORRT;
|
||||
_modelConfig.inpHeight = 640;
|
||||
@@ -159,6 +168,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig,modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSYOLOV10RTOD::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSYOLOV10RTOD::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "train_last";
|
||||
@@ -268,6 +286,15 @@ namespace ANSCENTER
|
||||
_modelLoadValid = false;
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSYOLOV10RTOD::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSYOLOV10RTOD::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
|
||||
@@ -59,6 +59,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSYOLOV12RTOD::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSYOLOV12RTOD::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
_modelConfig.modelType = ModelType::TENSORRT;
|
||||
_modelConfig.inpHeight = 640;
|
||||
@@ -152,6 +161,15 @@ namespace ANSCENTER
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig,modelName, className,modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSYOLOV12RTOD::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSYOLOV12RTOD::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "train_last";
|
||||
@@ -256,6 +274,15 @@ namespace ANSCENTER
|
||||
_modelLoadValid = false;
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSYOLOV12RTOD::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSYOLOV12RTOD::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// Parsing for YOLO only here
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.detectionType = ANSCENTER::DetectionType::DETECTION;
|
||||
|
||||
@@ -114,6 +114,15 @@ namespace ANSCENTER {
|
||||
|
||||
bool ANSMOVIENET::Initialize(std::string licenseKey, ModelConfig modelConfig, const std::string& modelZipFilePath, const std::string& modelZipPassword, std::string& labelMap) {
|
||||
bool result = ANSODBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSMOVIENET::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSMOVIENET::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
labelMap = "Face";
|
||||
_licenseValid = true;
|
||||
std::vector<std::string> labels{ labelMap };
|
||||
@@ -152,6 +161,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSMOVIENET::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSMOVIENET::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
int detectedW = 0, detectedH = 0;
|
||||
std::string onnxModel = ResolveMovinetModel(_modelFolder, detectedW, detectedH);
|
||||
@@ -174,6 +192,15 @@ namespace ANSCENTER {
|
||||
try {
|
||||
bool result = ANSODBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSMOVIENET::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSMOVIENET::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
_modelConfig = modelConfig;
|
||||
_modelConfig.modelType = ModelType::MOVIENET;
|
||||
|
||||
@@ -3,7 +3,16 @@
|
||||
namespace ANSCENTER {
|
||||
bool ANSRETINAFD::Initialize(std::string licenseKey, ModelConfig modelConfig, const std::string& modelZipFilePath, const std::string& modelZipPassword, std::string& labelMap) {
|
||||
bool result = ANSFDBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
// We do not need to check for the license
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSRETINAFD::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSRETINAFD::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
// We do not need to check for the license
|
||||
_licenseValid = true;
|
||||
if (!_licenseValid) return false;
|
||||
try {
|
||||
@@ -61,6 +70,15 @@ namespace ANSCENTER {
|
||||
// We need to get the _modelFolder
|
||||
bool result = ANSFDBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSRETINAFD::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSRETINAFD::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
// We need to get the modelfolder from here
|
||||
std::string onnxfile = CreateFilePath(_modelFolder, "retinaface.onnx");
|
||||
|
||||
@@ -14,6 +14,15 @@ namespace ANSCENTER {
|
||||
// Call base class Initialize
|
||||
bool result = ANSFDBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSSCRFDFD::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSSCRFDFD::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
labelMap = "Face";
|
||||
_licenseValid = true;
|
||||
try {
|
||||
@@ -75,6 +84,15 @@ namespace ANSCENTER {
|
||||
// We need to get the _modelFolder
|
||||
bool result = ANSFDBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSSCRFDFD::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSSCRFDFD::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
const bool engineAlreadyLoaded = _isInitialized && m_trtEngine != nullptr;
|
||||
_modelConfig.modelType = ModelType::FACEDETECT;
|
||||
_modelConfig.detectionType = DetectionType::FACEDETECTOR;
|
||||
@@ -133,6 +151,15 @@ namespace ANSCENTER {
|
||||
// We need to get the _modelFolder
|
||||
bool result = ANSFDBase::LoadModelFromFolder(licenseKey, modelConfig, modelName, className, modelFolder, labelMap);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSSCRFDFD::LoadModelFromFolder");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSSCRFDFD::LoadModelFromFolder",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
std::string _modelName = modelName;
|
||||
if (_modelName.empty()) {
|
||||
_modelName = "scrfdface";
|
||||
|
||||
@@ -5,8 +5,17 @@
|
||||
namespace ANSCENTER {
|
||||
bool ANSOVSCRFDFD::Initialize(std::string licenseKey, ModelConfig modelConfig, const std::string& modelZipFilePath, const std::string& modelZipPassword, std::string& labelMap) {
|
||||
bool result = ANSFDBase::Initialize(licenseKey, modelConfig, modelZipFilePath, modelZipPassword, labelMap);
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSOVSCRFDFD::Initialize");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOVSCRFDFD::Initialize",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
labelMap = "Face";
|
||||
// We do not need to check for the license
|
||||
// We do not need to check for the license
|
||||
_licenseValid = true;
|
||||
if (!_licenseValid) return false;
|
||||
try {
|
||||
@@ -101,6 +110,15 @@ namespace ANSCENTER {
|
||||
// We need to get the _modelFolder
|
||||
bool result = ANSFDBase::LoadModel(modelZipFilePath, modelZipPassword);
|
||||
if (!result) return false;
|
||||
// Serialize derived init against concurrent extract re-entries on the
|
||||
// same folder. See ModelFolderLockGuard in ANSEngineCommon.h.
|
||||
ModelFolderLockGuard _flg(_modelFolder, "ANSOVSCRFDFD::LoadModel");
|
||||
if (!_flg.acquired()) {
|
||||
this->_logger.LogError("ANSOVSCRFDFD::LoadModel",
|
||||
"Timed out waiting for model-folder lock: " + _modelFolder,
|
||||
__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
// We need to get the modelfolder from here
|
||||
std::string xmlfile = CreateFilePath(_modelFolder, "scrfdface.xml");
|
||||
|
||||
Reference in New Issue
Block a user