修改代码与文档
This commit is contained in:
parent
3a1c18c29d
commit
a97b708ed1
|
|
@ -20,9 +20,10 @@ from models import FaceRecoger, FaceBoxesV2, Landmark5er, FaceAlign, QualityOfCl
|
||||||
so = onnxruntime.SessionOptions()
|
so = onnxruntime.SessionOptions()
|
||||||
so.log_severity_level = 3 # 0=VERBOSE, 1=INFO, 2=WARNING, 3=ERROR, 4=FATAL
|
so.log_severity_level = 3 # 0=VERBOSE, 1=INFO, 2=WARNING, 3=ERROR, 4=FATAL
|
||||||
|
|
||||||
# # 获取workers
|
|
||||||
# if "NUM_WORKERS" not in os.environ:
|
# 获取workers
|
||||||
# raise RuntimeError("Environment variable NUM_WORKERS is required but not set.")
|
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))
|
NUM_WORKERS = int(os.getenv("NUM_WORKERS", 10))
|
||||||
|
|
||||||
# max readers
|
# max readers
|
||||||
|
|
@ -679,7 +680,7 @@ class FaceHelper:
|
||||||
# Calculate the Euclidean distance between features
|
# Calculate the Euclidean distance between features
|
||||||
distance = calculate_euclidean_distance(features_first, features_second)
|
distance = calculate_euclidean_distance(features_first, features_second)
|
||||||
# Compare distance with threshold
|
# Compare distance with threshold
|
||||||
return distance >= 0.75
|
return distance >= self.sim_threshold
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error occurred: {e}")
|
logger.error(f"Error occurred: {e}")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue