Fix mutex lock issues (OCR and FR)
This commit is contained in:
@@ -102,6 +102,7 @@ namespace ANSCENTER {
|
||||
std::vector<Object> ANSOVFD::RunInference(const cv::Mat& input, const std::string& camera_id, bool useDynamicImage, bool validateFace, bool facelivenessCheck) {
|
||||
// ── DML device-lost recovery (outside mutex) ──────────────
|
||||
if (_dmlDeviceLost && _face_detector) {
|
||||
if (_modelLoading.load()) return {};
|
||||
// The DML session is broken — recreate on CPU
|
||||
try {
|
||||
auto cpuDetector = std::make_unique<ANSCENTER::SCRFD>(
|
||||
@@ -136,6 +137,7 @@ namespace ANSCENTER {
|
||||
std::vector<Object> ANSOVFD::RunInference(const cv::Mat& input, bool useDynamicImage, bool validateFace, bool facelivenessCheck) {
|
||||
// ── DML device-lost recovery (outside mutex) ──────────────
|
||||
if (_dmlDeviceLost && _face_detector) {
|
||||
if (_modelLoading.load()) return {};
|
||||
try {
|
||||
auto cpuDetector = std::make_unique<ANSCENTER::SCRFD>(
|
||||
_scrfdModelPath, ANSCENTER::EngineType::CPU);
|
||||
|
||||
Reference in New Issue
Block a user