Skip to content

Commit d2623c7

Browse files
committed
refactor(coral-tpu): dynamically download deployment models instead of storing in git
Dropping the 13MB of binary .tflite files from the DeepCamera repository to prevent repository bloat. The installer scripts (deploy-macos.sh, deploy-linux.sh, and deploy.bat) now dynamically download the official standard detection models from Google's Edge TPU GitHub repository at deploy-time using curl (or Start-BitsTransfer on Windows).
1 parent 5e25be6 commit d2623c7

File tree

6 files changed

+32
-2
lines changed

6 files changed

+32
-2
lines changed

skills/detection/yolo-detection-2026-coral-tpu/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ volumes
5050

5151
# ─── Project Specific ────────────────────────────────
5252
src/yolov7_reid/src/models/mgn_R50-ibn.onnx
53+
*.tflite

skills/detection/yolo-detection-2026-coral-tpu/deploy-linux.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ if ! "$VENV_DIR/bin/python" -m pip install -r "$SKILL_DIR/requirements.txt"; the
122122
exit 1
123123
fi
124124

125+
# ─── Download Pre-compiled Models ───────────────────────────────────────────
126+
emit '{"event": "progress", "stage": "build", "message": "Downloading Edge TPU models..."}'
127+
mkdir -p "$SKILL_DIR/models"
128+
cd "$SKILL_DIR/models"
129+
curl -sSLO "https://github.com/google-coral/edgetpu/raw/master/test_data/ssd_mobilenet_v2_coco_quant_postprocess.tflite"
130+
curl -sSLO "https://github.com/google-coral/edgetpu/raw/master/test_data/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite"
131+
cd "$SKILL_DIR"
132+
125133
log "Linux deployment complete."
126134

127135
# ─── Probe for Edge TPU devices ──────────────────────────────────────────────

skills/detection/yolo-detection-2026-coral-tpu/deploy-macos.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ if ! "$VENV_DIR/bin/python" -m pip install --extra-index-url https://google-cora
117117
exit 1
118118
fi
119119

120+
# ─── Download Pre-compiled Models ───────────────────────────────────────────
121+
emit '{"event": "progress", "stage": "build", "message": "Downloading Edge TPU models..."}'
122+
mkdir -p "$SKILL_DIR/models"
123+
cd "$SKILL_DIR/models"
124+
curl -sSLO "https://github.com/google-coral/edgetpu/raw/master/test_data/ssd_mobilenet_v2_coco_quant_postprocess.tflite"
125+
curl -sSLO "https://github.com/google-coral/edgetpu/raw/master/test_data/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite"
126+
cd "$SKILL_DIR"
127+
120128
log "macOS deployment complete."
121129

122130
# ─── Probe for Edge TPU devices ──────────────────────────────────────────────

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,20 @@ if %errorlevel% neq 0 (
116116

117117
echo %LOG_PREFIX% Dependencies installed successfully. 1>&2
118118

119-
REM ─── Step 5: Probe for Edge TPU devices ────────────────────────────────────
119+
REM ─── Step 5: Download Pre-compiled Models ──────────────────────────────────
120+
121+
echo %LOG_PREFIX% Downloading Edge TPU models... 1>&2
122+
echo {"event": "progress", "stage": "build", "message": "Downloading Edge TPU models..."}
123+
124+
if not exist "%SKILL_DIR%models" mkdir "%SKILL_DIR%models"
125+
cd /d "%SKILL_DIR%models"
126+
127+
powershell -Command "Invoke-WebRequest -Uri 'https://github.com/google-coral/edgetpu/raw/master/test_data/ssd_mobilenet_v2_coco_quant_postprocess.tflite' -OutFile 'ssd_mobilenet_v2_coco_quant_postprocess.tflite'"
128+
powershell -Command "Invoke-WebRequest -Uri 'https://github.com/google-coral/edgetpu/raw/master/test_data/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite' -OutFile 'ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite'"
129+
130+
cd /d "%SKILL_DIR%"
131+
132+
REM ─── Step 6: Probe for Edge TPU devices ────────────────────────────────────
120133

121134
echo %LOG_PREFIX% Probing for Edge TPU devices natively... 1>&2
122135
echo {"event": "progress", "stage": "probe", "message": "Checking for physical Edge TPU..."}
@@ -137,7 +150,7 @@ if %errorlevel% equ 0 (
137150
echo {"event": "progress", "stage": "probe", "message": "No Edge TPU detected -- CPU fallback available"}
138151
)
139152

140-
REM ─── Step 6: Complete ──────────────────────────────────────────────────────
153+
REM ─── Step 7: Complete ──────────────────────────────────────────────────────
141154

142155
if "!TPU_FOUND!"=="true" (
143156
echo {"event": "complete", "status": "success", "tpu_found": true, "message": "Native Coral TPU skill installed -- Edge TPU ready"}

0 commit comments

Comments
 (0)