Skip to content

Develop - #184

Merged
solderzzc merged 9 commits into
masterfrom
develop
Apr 7, 2026
Merged

Develop#184
solderzzc merged 9 commits into
masterfrom
develop

Conversation

@solderzzc

Copy link
Copy Markdown
Member

No description provided.

solderzzc and others added 9 commits March 28, 2026 23:30
Was missing from the YOLO 2026 Hardware Acceleration section.
Links to the dedicated yolo-detection-2026-coral-tpu skill.
- Add docker/Dockerfile: linux/amd64 image with edgetpu_compiler + ultralytics
  Converts yolo26n.pt → TFLite INT8 → yolo26n_int8_edgetpu.tflite
- Add docker/compile.sh: one-shot runner that mounts models/ as output
- Add docker/docker-compose.yml: alternative Compose-based runner
- Add docker/README.md: full instructions for compile, commit, and use
- Rewrite deploy.bat (Option A — no pycoral):
  * Remove vestigial install_pycoral.py step (detect.py uses ai-edge-litert directly)
  * Check for pre-compiled yolo26n_edgetpu.tflite from git repo
  * Falls back to SSD MobileNet download if YOLO model not yet compiled
  * Cleaner UAC handling with unique temp dir names to prevent collisions
  * Informational Python version check (not blocking — 3.9-3.13 all work)
- Update requirements.txt: clarify no pycoral dependency, document libedgetpu
- Update models/README.md: Docker compile workflow + expected output files
Iteration notes on edgetpu_compiler v16 compatibility:
- TF 2.17 (onnx2tf >= 1.17): produces TFLite schema v6 → 'Invalid model'
- TF 2.13 + onnx2tf: Keras symbolic-tensor TypeError during INT8 calibration
- TF 2.13 + onnx-tf 1.10: strict=False conversion, SELECT_TF_OPS for YOLO ops
- numpy randint dtype fix (uint8 → float32 cast for representative dataset)

Docker image: python:3.9-slim + tensorflow-cpu==2.13.1 + onnx-tf==1.10.0
Pipeline: .pt → ONNX (opset 12) → SavedModel → TFLite INT8 → edgetpu_compiler
Remaining issue: CONV_2D shape inference in onnx-tf SavedModel during calibration
TODO: Use Google online compiler or EfficientDet-Lite as EdgeTPU-native backbone
…er pipeline

Model files (compiled via ultralytics format='edgetpu'):
  models/yolo26n_full_integer_quant_edgetpu.tflite  (2.7 MB, Edge TPU)
  models/yolo26n_int8.tflite                        (3.7 MB, CPU fallback)

Docker / compile pipeline:
  - Simplify Dockerfile: python:3.11-slim + ultralytics + edgetpu_compiler
    Let ultralytics manage onnx2tf/TF versions (format='edgetpu' uses onnx2tf 1.28.8)
  - Simplify compile_model.py: single call to model.export(format='edgetpu')
    Per https://docs.ultralytics.com/guides/coral-edge-tpu-on-raspberry-pi/
  - Removes all manual ONNX→SavedModel→TFLite pipeline complexity

detect.py:
  - Updated _find_model_path to prefer *_full_integer_quant_edgetpu.tflite
    (ultralytics naming convention) over legacy *_edgetpu.tflite pattern
Force-add to override .gitignore *.tflite exclusion.
These pre-compiled models are committed to the repo so deploy.bat/deploy.sh
can find them without needing a local Linux compilation environment.

  yolo26n_full_integer_quant_edgetpu.tflite  (2.7 MB) — Edge TPU accelerated
  yolo26n_int8.tflite                        (3.7 MB) — CPU fallback

Compiled with: ultralytics format='edgetpu', size=320, edgetpu_compiler v16
- Increase local /metrics scrape timeout to 5 minutes to accommodate server-side metric compilation for very large scale zero-copy graphs.
- Add new cloud-provider-regression analysis skill.
@solderzzc
solderzzc merged commit 50a59bc into master Apr 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant