Face recognition: use Coral device :2 (avoid conflict with YAMNet :0 and pose :1)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -24,12 +24,12 @@ FACE_DETECT_INTERVAL = 2.0 # seconds between face detection runs in process_fra
|
|||||||
|
|
||||||
|
|
||||||
class FaceRecognizer:
|
class FaceRecognizer:
|
||||||
def __init__(self, face_model_path, embed_model_path, db_path="faces.db"):
|
def __init__(self, face_model_path, embed_model_path, db_path="faces.db", coral_device=2):
|
||||||
self._lock = threading.Lock()
|
self._lock = threading.Lock()
|
||||||
|
|
||||||
# Coral face detector
|
# Coral face detector (device index avoids conflict with YAMNet on :0 and pose on :1)
|
||||||
logger.info("Loading face detection model on Edge TPU...")
|
logger.info("Loading face detection model on Edge TPU (device :%d)...", coral_device)
|
||||||
delegate = tfl.load_delegate("libedgetpu.so.1")
|
delegate = tfl.load_delegate("libedgetpu.so.1", options={"device": f":{coral_device}"})
|
||||||
self._face_interp = tfl.Interpreter(
|
self._face_interp = tfl.Interpreter(
|
||||||
model_path=str(face_model_path),
|
model_path=str(face_model_path),
|
||||||
experimental_delegates=[delegate],
|
experimental_delegates=[delegate],
|
||||||
|
|||||||
Reference in New Issue
Block a user