Make Edge TPU opt-in via USE_EDGETPU env var
libedgetpu on Pi 5 segfaults with the compiled model. CPU fallback works fine (~50-100ms at 0.5s intervals). Set USE_EDGETPU=1 in headmic.service to enable once runtime is fixed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -469,8 +469,8 @@ async def startup():
|
|||||||
edgetpu_model_path = model_dir / "yamnet_edgetpu.tflite"
|
edgetpu_model_path = model_dir / "yamnet_edgetpu.tflite"
|
||||||
model_path = model_dir / "yamnet.tflite"
|
model_path = model_dir / "yamnet.tflite"
|
||||||
class_map_path = model_dir / "yamnet_class_map.csv"
|
class_map_path = model_dir / "yamnet_class_map.csv"
|
||||||
# Prefer Edge TPU model if available
|
# Edge TPU opt-in via env var (segfaults with some libedgetpu versions)
|
||||||
use_edgetpu = edgetpu_model_path.exists()
|
use_edgetpu = os.environ.get("USE_EDGETPU", "").lower() in ("1", "true", "yes") and edgetpu_model_path.exists()
|
||||||
active_model = edgetpu_model_path if use_edgetpu else model_path
|
active_model = edgetpu_model_path if use_edgetpu else model_path
|
||||||
if active_model.exists() and class_map_path.exists():
|
if active_model.exists() and class_map_path.exists():
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user