mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-13 13:47:36 +02:00
pass face recognition config instead of whole config
This commit is contained in:
parent
703bc1229e
commit
b6cfc78b28
@ -267,7 +267,7 @@ class ArcFaceRecognizer(FaceRecognizer):
|
|||||||
def __init__(self, config: FrigateConfig):
|
def __init__(self, config: FrigateConfig):
|
||||||
super().__init__(config)
|
super().__init__(config)
|
||||||
self.mean_embs: dict[int, np.ndarray] = {}
|
self.mean_embs: dict[int, np.ndarray] = {}
|
||||||
self.face_embedder: ArcfaceEmbedding = ArcfaceEmbedding(config)
|
self.face_embedder: ArcfaceEmbedding = ArcfaceEmbedding(config.face_recognition)
|
||||||
self.model_builder_queue: queue.Queue | None = None
|
self.model_builder_queue: queue.Queue | None = None
|
||||||
|
|
||||||
def clear(self) -> None:
|
def clear(self) -> None:
|
||||||
|
@ -10,7 +10,7 @@ from frigate.util.downloader import ModelDownloader
|
|||||||
|
|
||||||
from .base_embedding import BaseEmbedding
|
from .base_embedding import BaseEmbedding
|
||||||
from .runner import ONNXModelRunner
|
from .runner import ONNXModelRunner
|
||||||
from ...config import FrigateConfig
|
from ...config import FaceRecognitionConfig
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from tflite_runtime.interpreter import Interpreter
|
from tflite_runtime.interpreter import Interpreter
|
||||||
@ -110,7 +110,7 @@ class FaceNetEmbedding(BaseEmbedding):
|
|||||||
|
|
||||||
|
|
||||||
class ArcfaceEmbedding(BaseEmbedding):
|
class ArcfaceEmbedding(BaseEmbedding):
|
||||||
def __init__(self, config: FrigateConfig):
|
def __init__(self, config: FaceRecognitionConfig):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
model_name="facedet",
|
model_name="facedet",
|
||||||
model_file="arcface.onnx",
|
model_file="arcface.onnx",
|
||||||
@ -148,7 +148,7 @@ class ArcfaceEmbedding(BaseEmbedding):
|
|||||||
|
|
||||||
self.runner = ONNXModelRunner(
|
self.runner = ONNXModelRunner(
|
||||||
os.path.join(self.download_path, self.model_file),
|
os.path.join(self.download_path, self.model_file),
|
||||||
device=self.config.face_recognition.device or "GPU",
|
device=self.config.device or "GPU",
|
||||||
)
|
)
|
||||||
|
|
||||||
def _preprocess_inputs(self, raw_inputs):
|
def _preprocess_inputs(self, raw_inputs):
|
||||||
|
Loading…
Reference in New Issue
Block a user