Skip to content

Commit f024dd1

Browse files
committed
fix: deploy.bat UAC directory bug and suppress ai-edge-litert AttributeError
1 parent 7ec9f6e commit f024dd1

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

skills/detection/yolo-detection-2026-coral-tpu/deploy.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ echo {"event": "progress", "stage": "platform", "message": "A UAC prompt will ap
5858
REM Run install.bat elevated and wait for it to complete.
5959
REM The '<nul' suppresses the clock-speed interactive prompt (uses the default: standard).
6060
powershell -NoProfile -Command ^
61-
"Start-Process -FilePath 'cmd.exe' -ArgumentList '/c install.bat <nul' -Verb RunAs -Wait"
61+
"Start-Process -FilePath 'cmd.exe' -ArgumentList '/c install.bat <nul' -WorkingDirectory '%TMP_DIR%\edgetpu_runtime' -Verb RunAs -Wait"
6262

6363
if %errorlevel% neq 0 (
6464
echo.
@@ -212,5 +212,5 @@ if "!TPU_FOUND!"=="true" (
212212
exit /b 0
213213
) else (
214214
echo {"event": "complete", "status": "partial", "tpu_found": false, "message": "Coral TPU skill installed. Plug in your Coral USB Accelerator to enable hardware acceleration."}
215-
exit /b 2
215+
exit /b 0
216216
)

skills/detection/yolo-detection-2026-coral-tpu/scripts/detect.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,18 @@ def _load_model(self):
232232
# Try loading with Edge TPU delegate
233233
edgetpu_lib = _edgetpu_lib_name()
234234
try:
235+
# Squelch __del__ AttributeError bugs in ai-edge-litert when delegate fails to load
236+
if hasattr(litert, 'Delegate'):
237+
original_del = getattr(litert.Delegate, '__del__', None)
238+
if original_del and not hasattr(litert.Delegate, '_patched_del'):
239+
def safe_del(self):
240+
try:
241+
original_del(self)
242+
except AttributeError:
243+
pass
244+
litert.Delegate.__del__ = safe_del
245+
litert.Delegate._patched_del = True
246+
235247
delegate = litert.load_delegate(edgetpu_lib)
236248
self.interpreter = litert.Interpreter(
237249
model_path=model_path,

0 commit comments

Comments
 (0)