Skip to content

Commit b7bcb81

Browse files
committed
fix(yolo-win-wsl): resolve deploy.bat crashes, usbipd PATH resolution, and litert import discrepancy
1 parent a2fce18 commit b7bcb81

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

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

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if %errorlevel% neq 0 (
2020

2121
where wsl >nul 2>nul
2222
if %errorlevel% neq 0 (
23-
call :ColorText 0C "ERROR: WSL is still not installed. Aborting deployment."
23+
echo ERROR: WSL is still not installed. Aborting deployment.
2424
exit /b 1
2525
)
2626
)
@@ -32,9 +32,13 @@ if %errorlevel% neq 0 (
3232
set /p DUMMY="Waiting for user to install usbipd and click Done..."
3333

3434
where usbipd >nul 2>nul
35-
if %errorlevel% neq 0 (
36-
call :ColorText 0C "ERROR: usbipd is still not installed. Aborting deployment."
37-
exit /b 1
35+
if !errorlevel! neq 0 (
36+
if exist "C:\Program Files\usbipd-win\usbipd.exe" (
37+
set "PATH=%PATH%;C:\Program Files\usbipd-win\"
38+
) else (
39+
echo ERROR: usbipd is still not installed. Aborting deployment.
40+
exit /b 1
41+
)
3842
)
3943
)
4044

@@ -54,7 +58,7 @@ echo.
5458
echo [2/4] Initializing WSL Python 3.9 environment...
5559
wsl -u root -e bash -c "apt-get update && apt-get install -y software-properties-common curl wget libusb-1.0-0 && add-apt-repository -y ppa:deadsnakes/ppa && apt-get update && apt-get install -y python3.9 python3.9-venv python3.9-distutils"
5660
if %errorlevel% neq 0 (
57-
call :ColorText 0C "ERROR: Failed to install Python 3.9 in WSL. Ensure you have internet access and WSL is running Ubuntu."
61+
echo ERROR: Failed to install Python 3.9 in WSL. Ensure you have internet access and WSL is running Ubuntu.
5862
exit /b 1
5963
)
6064

@@ -63,26 +67,20 @@ echo.
6367
echo [3/4] Creating Virtual Environment...
6468
wsl -e bash -c "cd '%DIR_PATH%' && python3.9 -m venv wsl_venv"
6569
if %errorlevel% neq 0 (
66-
call :ColorText 0C "ERROR: Failed to create venv."
70+
echo ERROR: Failed to create venv.
6771
exit /b 1
6872
)
6973

7074
:: 7. Install Python Packages and EdgeTPU Lib
7175
echo.
72-
echo [4/4] Installing tflite-runtime and Coral TPU drivers...
73-
wsl -e bash -c "cd '%DIR_PATH%' && source wsl_venv/bin/activate && curl -sS https://bootstrap.pypa.io/get-pip.py | python3.9 && python3.9 -m pip install tflite-runtime==2.14.0 numpy pillow"
76+
echo [4/4] Installing Python requirements and Coral TPU drivers...
77+
wsl -e bash -c "cd '%DIR_PATH%' && source wsl_venv/bin/activate && curl -sS https://bootstrap.pypa.io/get-pip.py | python3.9 && python3.9 -m pip install -r requirements.txt"
7478
wsl -u root -e bash -c "cd '%DIR_PATH%' && wget -qO libedgetpu.deb https://packages.cloud.google.com/apt/pool/coral-edgetpu-stable/libedgetpu1-max_16.0_amd64_0ac21f1924dd4b125d5cfc5f6d0e4a5e.deb && dpkg -x libedgetpu.deb ext && cp ext/usr/lib/x86_64-linux-gnu/libedgetpu.so.1.0 libedgetpu.so.1 && rm -rf ext libedgetpu.deb"
7579

7680
echo.
77-
call :ColorText 0A "SUCCESS: Windows WSL Deployment Complete!"
81+
echo.
82+
echo SUCCESS: Windows WSL Deployment Complete!
7883
echo.
7984
echo Aegis-AI is ready to trigger the detection node natively on WSL!
8085
echo You can safely close this terminal.
8186
exit /b 0
82-
83-
:ColorText
84-
<nul set /p ".=%DEL%" > "%~2"
85-
findstr /v /a:%1 /R "^$" "%~2" nul
86-
del "%~2" > nul 2>&1
87-
echo.
88-
goto :eof

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@
3232
HAS_LITERT = False
3333

3434
try:
35-
import tflite_runtime.interpreter as litert # interpreter as litert
35+
import ai_edge_litert.interpreter as litert # Modern LiteRT (rebranded)
3636
HAS_LITERT = True
3737
except ImportError:
38-
sys.stderr.write("[coral-detect] WARNING: ai-edge-litert not installed\n")
38+
try:
39+
import tflite_runtime.interpreter as litert # Legacy PyCoral/TF
40+
HAS_LITERT = True
41+
except ImportError:
42+
sys.stderr.write("[coral-detect] WARNING: ai-edge-litert or tflite_runtime not installed\n")
3943

4044

4145
def log(message: str) -> None:

0 commit comments

Comments
 (0)