Remove locks

This commit is contained in:
2026-04-24 17:10:29 +10:00
parent 7a11c9617b
commit 3a527d2dad
51 changed files with 38 additions and 1251 deletions

View File

@@ -5,15 +5,6 @@
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
_licenseValid = true;
@@ -46,7 +37,6 @@ namespace ANSCENTER {
<< model->input().get_any_name() << "' will be used." << slog::endl;
}
const ov::Layout& inputLayout = layout;
//ppp.input().tensor().set_element_type(ov::element::u8).set_layout("NHWC").set_color_format(ov::preprocess::ColorFormat::BGR);
@@ -70,7 +60,6 @@ namespace ANSCENTER {
int outputSize = model->outputs().size();
std::cout << "output Size:" << outputSize << std::endl;
const ov::Layout outputLayout{ "CHW" };
maxProposalsCount = model->outputs().front().get_shape()[ov::layout::height_idx(outputLayout)];
for (const auto& output : model->outputs()) {
@@ -110,15 +99,6 @@ 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");
@@ -257,7 +237,6 @@ namespace ANSCENTER {
// Perform inference
inference_request_.infer();
std::cout << "Model outputs:" << std::endl;
auto ovOutputs= compiled_model_.outputs();
for (int i = 0; i < ovOutputs.size();i++) {
@@ -288,7 +267,6 @@ namespace ANSCENTER {
std::cout << "Total valid detections: " << valid_detections.size() << std::endl;
/* float* score = inference_request_.get_output_tensor(2).data<float>();
//if (score != nullptr) {
// std::cout << "Score:" << score[0]<<std::endl;
@@ -296,7 +274,6 @@ namespace ANSCENTER {
float* bbox = inference_request_.get_output_tensor(5).data<float>();*/
// Get the output tensor
//// Step 0: Prepare input
//this->PreprocessImage(im);