修改代码与文档

This commit is contained in:
jiang 2024-09-18 15:42:50 +08:00
parent 3a1c18c29d
commit a97b708ed1
1 changed files with 5 additions and 4 deletions

View File

@ -20,9 +20,10 @@ from models import FaceRecoger, FaceBoxesV2, Landmark5er, FaceAlign, QualityOfCl
so = onnxruntime.SessionOptions()
so.log_severity_level = 3 # 0=VERBOSE, 1=INFO, 2=WARNING, 3=ERROR, 4=FATAL
# # 获取workers
# if "NUM_WORKERS" not in os.environ:
# raise RuntimeError("Environment variable NUM_WORKERS is required but not set.")
# 获取workers
if "NUM_WORKERS" not in os.environ:
raise RuntimeError("Environment variable NUM_WORKERS is required but not set.")
NUM_WORKERS = int(os.getenv("NUM_WORKERS", 10))
# max readers
@ -679,7 +680,7 @@ class FaceHelper:
# Calculate the Euclidean distance between features
distance = calculate_euclidean_distance(features_first, features_second)
# Compare distance with threshold
return distance >= 0.75
return distance >= self.sim_threshold
except Exception as e:
logger.error(f"Error occurred: {e}")