|
| 1 | +--- |
| 2 | +name: yolo-detection-2026-coral-tpu |
| 3 | +description: "Google Coral Edge TPU — real-time object detection via Docker" |
| 4 | +version: 1.0.0 |
| 5 | +icon: assets/icon.png |
| 6 | +entry: scripts/detect.py |
| 7 | +deploy: deploy.sh |
| 8 | +runtime: docker |
| 9 | + |
| 10 | +requirements: |
| 11 | + docker: ">=20.10" |
| 12 | + platforms: ["linux", "macos", "windows"] |
| 13 | + |
| 14 | +parameters: |
| 15 | + - name: auto_start |
| 16 | + label: "Auto Start" |
| 17 | + type: boolean |
| 18 | + default: false |
| 19 | + description: "Start this skill automatically when Aegis launches" |
| 20 | + group: Lifecycle |
| 21 | + |
| 22 | + - name: confidence |
| 23 | + label: "Confidence Threshold" |
| 24 | + type: number |
| 25 | + min: 0.1 |
| 26 | + max: 1.0 |
| 27 | + default: 0.5 |
| 28 | + description: "Minimum detection confidence — lower than GPU models due to INT8 quantization" |
| 29 | + group: Model |
| 30 | + |
| 31 | + - name: classes |
| 32 | + label: "Detect Classes" |
| 33 | + type: string |
| 34 | + default: "person,car,dog,cat" |
| 35 | + description: "Comma-separated COCO class names (80 classes available)" |
| 36 | + group: Model |
| 37 | + |
| 38 | + - name: fps |
| 39 | + label: "Processing FPS" |
| 40 | + type: select |
| 41 | + options: [0.2, 0.5, 1, 3, 5, 15] |
| 42 | + default: 5 |
| 43 | + description: "Frames per second — Edge TPU handles 15+ FPS easily" |
| 44 | + group: Performance |
| 45 | + |
| 46 | + - name: input_size |
| 47 | + label: "Input Resolution" |
| 48 | + type: select |
| 49 | + options: [320, 640] |
| 50 | + default: 320 |
| 51 | + description: "320 fits fully on TPU (~4ms), 640 partially on CPU (~20ms)" |
| 52 | + group: Performance |
| 53 | + |
| 54 | + - name: tpu_device |
| 55 | + label: "TPU Device" |
| 56 | + type: select |
| 57 | + options: ["auto", "0", "1", "2", "3"] |
| 58 | + default: "auto" |
| 59 | + description: "Which Edge TPU to use — auto selects first available" |
| 60 | + group: Performance |
| 61 | + |
| 62 | + - name: clock_speed |
| 63 | + label: "TPU Clock Speed" |
| 64 | + type: select |
| 65 | + options: ["standard", "max"] |
| 66 | + default: "standard" |
| 67 | + description: "Max is faster but runs hotter — needs active cooling for sustained use" |
| 68 | + group: Performance |
| 69 | + |
| 70 | +capabilities: |
| 71 | + live_detection: |
| 72 | + script: scripts/detect.py |
| 73 | + description: "Real-time object detection on live camera frames via Edge TPU" |
| 74 | + |
| 75 | +category: detection |
| 76 | +mutex: detection |
| 77 | +--- |
| 78 | + |
| 79 | +# Coral TPU Object Detection |
| 80 | + |
| 81 | +Real-time object detection using Google Coral Edge TPU accelerator. Runs inside Docker for cross-platform support. Detects 80 COCO classes (person, car, dog, cat, etc.) with ~4ms inference on 320×320 input. |
| 82 | + |
| 83 | +## Requirements |
| 84 | + |
| 85 | +- **Google Coral USB Accelerator** (USB 3.0 port recommended) |
| 86 | +- **Docker Desktop 4.35+** (all platforms — Linux, macOS, Windows) |
| 87 | +- USB 3.0 cable (the included cable is recommended) |
| 88 | +- Adequate cooling for sustained inference |
| 89 | + |
| 90 | +## How It Works |
| 91 | + |
| 92 | +``` |
| 93 | +┌─────────────────────────────────────────────────────┐ |
| 94 | +│ Host (Aegis-AI) │ |
| 95 | +│ frame.jpg → /tmp/aegis_detection/ │ |
| 96 | +│ stdin ──→ ┌──────────────────────────────┐ │ |
| 97 | +│ │ Docker Container │ │ |
| 98 | +│ │ detect.py │ │ |
| 99 | +│ │ ├─ loads _edgetpu.tflite │ │ |
| 100 | +│ │ ├─ reads frame from volume │ │ |
| 101 | +│ │ └─ runs inference on TPU │ │ |
| 102 | +│ stdout ←── │ → JSONL detections │ │ |
| 103 | +│ └──────────────────────────────┘ │ |
| 104 | +│ USB ──→ /dev/bus/usb (Linux) or USB/IP (Mac/Win) │ |
| 105 | +└─────────────────────────────────────────────────────┘ |
| 106 | +``` |
| 107 | + |
| 108 | +1. Aegis writes camera frame JPEG to shared `/tmp/aegis_detection/` volume |
| 109 | +2. Sends `frame` event via stdin JSONL to Docker container |
| 110 | +3. `detect.py` reads frame, runs inference on Edge TPU |
| 111 | +4. Returns `detections` event via stdout JSONL |
| 112 | +5. Same protocol as `yolo-detection-2026` — Aegis sees no difference |
| 113 | + |
| 114 | +## Platform Setup |
| 115 | + |
| 116 | +### Linux |
| 117 | +```bash |
| 118 | +# USB Coral should be auto-detected |
| 119 | +# Docker uses --device /dev/bus/usb for direct access |
| 120 | +./deploy.sh |
| 121 | +``` |
| 122 | + |
| 123 | +### macOS (Docker Desktop 4.35+) |
| 124 | +```bash |
| 125 | +# Docker Desktop USB/IP handles USB passthrough |
| 126 | +# ARM64 Docker image builds natively on Apple Silicon |
| 127 | +./deploy.sh |
| 128 | +``` |
| 129 | + |
| 130 | +### Windows |
| 131 | +```powershell |
| 132 | +# Docker Desktop 4.35+ with USB/IP support |
| 133 | +# Or WSL2 backend with usbipd-win |
| 134 | +.\deploy.bat |
| 135 | +``` |
| 136 | + |
| 137 | +## Model |
| 138 | + |
| 139 | +Ships with pre-compiled `yolo26n_edgetpu.tflite` (YOLO 2026 nano, INT8 quantized, 320×320). To compile custom models: |
| 140 | + |
| 141 | +```bash |
| 142 | +# Requires x86_64 Linux or Docker --platform linux/amd64 |
| 143 | +python scripts/compile_model.py --model yolo26s --size 320 |
| 144 | +``` |
| 145 | + |
| 146 | +## Performance |
| 147 | + |
| 148 | +| Input Size | Inference | On-chip | Notes | |
| 149 | +|-----------|-----------|---------|-------| |
| 150 | +| 320×320 | ~4ms | 100% | Fully on TPU, best for real-time | |
| 151 | +| 640×640 | ~20ms | Partial | Some layers on CPU (model segmented) | |
| 152 | + |
| 153 | +> **Cooling**: The USB Accelerator aluminum case acts as a heatsink. If too hot to touch during continuous inference, it will thermal-throttle. Consider active cooling or `clock_speed: standard`. |
| 154 | +
|
| 155 | +## Protocol |
| 156 | + |
| 157 | +Same JSONL as `yolo-detection-2026`: |
| 158 | + |
| 159 | +### Skill → Aegis (stdout) |
| 160 | +```jsonl |
| 161 | +{"event": "ready", "model": "yolo26n_edgetpu", "device": "coral", "format": "edgetpu_tflite", "tpu_count": 1, "classes": 80} |
| 162 | +{"event": "detections", "frame_id": 42, "camera_id": "front_door", "objects": [{"class": "person", "confidence": 0.85, "bbox": [100, 50, 300, 400]}]} |
| 163 | +{"event": "perf_stats", "total_frames": 50, "timings_ms": {"inference": {"avg": 4.1, "p50": 3.9, "p95": 5.2}}} |
| 164 | +``` |
| 165 | + |
| 166 | +### Bounding Box Format |
| 167 | +`[x_min, y_min, x_max, y_max]` — pixel coordinates (xyxy). |
| 168 | + |
| 169 | +## Installation |
| 170 | + |
| 171 | +```bash |
| 172 | +./deploy.sh |
| 173 | +``` |
| 174 | + |
| 175 | +The deployer builds the Docker image locally, probes for TPU devices, and sets the runtime command. No packages pulled from external registries beyond Docker base images and Coral apt repo. |
0 commit comments