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:
Alex
2026-04-18 20:29:56 -05:00
parent 0bbd54b40f
commit 1664661ae7

View File

@@ -24,12 +24,12 @@ FACE_DETECT_INTERVAL = 2.0 # seconds between face detection runs in process_fra
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()
# Coral face detector
logger.info("Loading face detection model on Edge TPU...")
delegate = tfl.load_delegate("libedgetpu.so.1")
# Coral face detector (device index avoids conflict with YAMNet on :0 and pose on :1)
logger.info("Loading face detection model on Edge TPU (device :%d)...", coral_device)
delegate = tfl.load_delegate("libedgetpu.so.1", options={"device": f":{coral_device}"})
self._face_interp = tfl.Interpreter(
model_path=str(face_model_path),
experimental_delegates=[delegate],