Compare commits

...

3 Commits

Author SHA1 Message Date
leccelecce
0947bffeef
nginx: don't gzip png, gif, jpeg or jpg (#17400) 2025-03-26 19:48:28 -05:00
Nicolas Mowen
ff34739f40
Face recognition bug fixes (#17401)
* Simplify normalization

* Fix confidence check
2025-03-26 19:43:10 -05:00
leccelecce
a37f804469
i18n Settings fixes (#17398) 2025-03-26 17:51:54 -06:00
5 changed files with 22 additions and 23 deletions

View File

@ -30,7 +30,7 @@ http {
gzip on; gzip on;
gzip_comp_level 6; gzip_comp_level 6;
gzip_types text/plain text/css application/json application/x-javascript application/javascript text/javascript image/svg+xml image/x-icon image/bmp image/png image/gif image/jpeg image/jpg; gzip_types text/plain text/css application/json application/x-javascript application/javascript text/javascript image/svg+xml image/x-icon image/bmp;
gzip_proxied no-cache no-store private expired auth; gzip_proxied no-cache no-store private expired auth;
gzip_vary on; gzip_vary on;

View File

@ -10,7 +10,7 @@ from scipy import stats
from frigate.config import FrigateConfig from frigate.config import FrigateConfig
from frigate.const import MODEL_CACHE_DIR from frigate.const import MODEL_CACHE_DIR
from frigate.embeddings.onnx.facenet import ArcfaceEmbedding from frigate.embeddings.onnx.face_embedding import ArcfaceEmbedding
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -329,7 +329,7 @@ class ArcFaceRecognizer(FaceRecognizer):
cosine_similarity = dot_product / (magnitude_A * magnitude_B) cosine_similarity = dot_product / (magnitude_A * magnitude_B)
confidence = self.similarity_to_confidence(cosine_similarity) confidence = self.similarity_to_confidence(cosine_similarity)
if cosine_similarity > score: if confidence > score:
score = confidence score = confidence
label = name label = name

View File

@ -90,8 +90,7 @@ class ArcfaceEmbedding(BaseEmbedding):
frame[y_center : y_center + og_h, x_center : x_center + og_w] = og frame[y_center : y_center + og_h, x_center : x_center + og_w] = og
# run arcface normalization # run arcface normalization
normalized_image = frame.astype(np.float32) / 255.0 frame = (frame / 127.5) - 1.0
frame = (normalized_image - 0.5) / 0.5
frame = np.transpose(frame, (2, 0, 1)) frame = np.transpose(frame, (2, 0, 1))
frame = np.expand_dims(frame, axis=0) frame = np.expand_dims(frame, axis=0)

View File

@ -11,9 +11,9 @@
"frigatePlus": "Frigate+ Settings - Frigate" "frigatePlus": "Frigate+ Settings - Frigate"
}, },
"menu": { "menu": {
"uiSettings": "UI Settings", "ui": "UI",
"classificationSettings": "Classification Settings", "classification": "Classification",
"cameraSettings": "Camera Settings", "cameras": "Camera Settings",
"masksAndZones": "Masks / Zones", "masksAndZones": "Masks / Zones",
"motionTuner": "Motion Tuner", "motionTuner": "Motion Tuner",
"debug": "Debug", "debug": "Debug",

View File

@ -11,9 +11,9 @@
"frigatePlus": "Frigate+ 设置 - Frigate" "frigatePlus": "Frigate+ 设置 - Frigate"
}, },
"menu": { "menu": {
"uiSettings": "界面设置", "ui": "界面设置",
"classificationSettings": "分类设置", "classification": "分类设置",
"cameraSettings": "摄像头设置", "cameras": "摄像头设置",
"masksAndZones": "遮罩/ 区域", "masksAndZones": "遮罩/ 区域",
"motionTuner": "运动调整器", "motionTuner": "运动调整器",
"debug": "调试", "debug": "调试",
@ -109,16 +109,16 @@
"desc": "人脸识别功能允许为人物分配名称当识别到他们的面孔时Frigate 会将人物的名字作为子标签进行分配。这些信息会显示在界面、过滤器以及通知中。", "desc": "人脸识别功能允许为人物分配名称当识别到他们的面孔时Frigate 会将人物的名字作为子标签进行分配。这些信息会显示在界面、过滤器以及通知中。",
"readTheDocumentation": "阅读文档(英文)", "readTheDocumentation": "阅读文档(英文)",
"modelSize": { "modelSize": {
"label": "模型大小", "label": "模型大小",
"desc": "用于人脸识别的模型尺寸。", "desc": "用于人脸识别的模型尺寸。",
"small": { "small": {
"title": "小模型", "title": "小模型",
"desc": "使用<em>小模型</em>将采用OpenCV的局部二值模式直方图(LBPH)算法可在大多数CPU上高效运行。" "desc": "使用<em>小模型</em>将采用OpenCV的局部二值模式直方图(LBPH)算法可在大多数CPU上高效运行。"
}, },
"large": { "large": {
"title": "大模型", "title": "大模型",
"desc": "使用<em>大模型</em>将采用ArcFace人脸嵌入模型若适用将自动在GPU上运行。" "desc": "使用<em>大模型</em>将采用ArcFace人脸嵌入模型若适用将自动在GPU上运行。"
} }
} }
}, },
"licensePlateRecognition": { "licensePlateRecognition": {
@ -565,8 +565,8 @@
"modelSelect": "您可以在Frigate+上选择可用的模型。请注意,只能选择与当前探测器配置兼容的模型。" "modelSelect": "您可以在Frigate+上选择可用的模型。请注意,只能选择与当前探测器配置兼容的模型。"
}, },
"toast": { "toast": {
"success": "Frigate+ 设置已保存。请重启 Frigate 以应用更改。", "success": "Frigate+ 设置已保存。请重启 Frigate 以应用更改。",
"error": "配置更改保存失败:{{errorMessage}}" "error": "配置更改保存失败:{{errorMessage}}"
} }
} }
} }