@blueharford/scrypted-spatial-awareness 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -3
- package/dist/main.nodejs.js +1 -1
- package/dist/main.nodejs.js.map +1 -1
- package/dist/plugin.zip +0 -0
- package/out/main.nodejs.js +1889 -20
- package/out/main.nodejs.js.map +1 -1
- package/package.json +1 -1
- package/src/core/tracking-engine.ts +588 -1
- package/src/main.ts +345 -20
- package/src/models/training.ts +300 -0
- package/src/ui/training-html.ts +1007 -0
- package/out/plugin.zip +0 -0
package/README.md
CHANGED
|
@@ -73,12 +73,21 @@ This plugin **tracks objects across your entire camera system**, understanding t
|
|
|
73
73
|
- **AI Landmark Suggestions**: System learns to identify landmarks from camera footage over time
|
|
74
74
|
- **Spatial Relationships**: Auto-inferred relationships between cameras and landmarks based on position
|
|
75
75
|
|
|
76
|
-
### Automatic Learning
|
|
76
|
+
### Automatic Learning
|
|
77
77
|
- **Transit Time Learning**: Automatically adjusts connection transit times based on observed movement patterns
|
|
78
78
|
- **Connection Suggestions**: System suggests new camera connections based on observed object movements
|
|
79
79
|
- **Confidence Scoring**: Suggestions include confidence scores based on consistency of observations
|
|
80
80
|
- **One-Click Approval**: Accept or reject suggestions directly from the topology editor
|
|
81
81
|
|
|
82
|
+
### Training Mode (NEW in v0.4.0)
|
|
83
|
+
- **Guided Walkthrough**: Walk your property and let the system learn your camera layout
|
|
84
|
+
- **Mobile-Optimized UI**: Designed for phone use while walking around
|
|
85
|
+
- **Auto Camera Detection**: System detects you automatically as you walk
|
|
86
|
+
- **Transit Time Recording**: Learns actual transit times between cameras
|
|
87
|
+
- **Overlap Detection**: Identifies where camera coverage overlaps
|
|
88
|
+
- **Landmark Marking**: Mark landmarks (mailbox, gate, etc.) as you encounter them
|
|
89
|
+
- **One-Click Setup**: Apply training results to generate your complete topology
|
|
90
|
+
|
|
82
91
|
### Integrations
|
|
83
92
|
- **MQTT Integration**: Export tracking data to Home Assistant for automations
|
|
84
93
|
- **REST API**: Query tracked objects and journeys programmatically
|
|
@@ -96,7 +105,68 @@ npm install @blueharford/scrypted-spatial-awareness
|
|
|
96
105
|
3. Search for "@blueharford/scrypted-spatial-awareness"
|
|
97
106
|
4. Click Install
|
|
98
107
|
|
|
99
|
-
##
|
|
108
|
+
## Getting Started: Training Mode (NEW in v0.4.0)
|
|
109
|
+
|
|
110
|
+
The fastest way to set up Spatial Awareness is using **Training Mode** - a guided walkthrough where you physically walk around your property while the system learns your camera layout.
|
|
111
|
+
|
|
112
|
+
### Why Training Mode?
|
|
113
|
+
|
|
114
|
+
Instead of manually drawing connections and guessing transit times, simply:
|
|
115
|
+
1. Start training on your phone
|
|
116
|
+
2. Walk between cameras
|
|
117
|
+
3. The system automatically learns:
|
|
118
|
+
- Which cameras can see you
|
|
119
|
+
- How long it takes to walk between cameras
|
|
120
|
+
- Where cameras overlap
|
|
121
|
+
- Your property's layout
|
|
122
|
+
|
|
123
|
+
### Quick Start
|
|
124
|
+
|
|
125
|
+
1. **Open Training Mode**
|
|
126
|
+
- Navigate to: `/endpoint/@blueharford/scrypted-spatial-awareness/ui/training`
|
|
127
|
+
- Or scan the QR code in the plugin settings (mobile-optimized)
|
|
128
|
+
|
|
129
|
+
2. **Start Training**
|
|
130
|
+
- Tap "Start Training"
|
|
131
|
+
- The system begins listening for person detections
|
|
132
|
+
|
|
133
|
+
3. **Walk Your Property**
|
|
134
|
+
- Walk to each camera on your property
|
|
135
|
+
- The system detects you automatically and records:
|
|
136
|
+
- Camera positions
|
|
137
|
+
- Transit times between cameras
|
|
138
|
+
- Camera overlaps (when both cameras see you)
|
|
139
|
+
|
|
140
|
+
4. **Mark Landmarks** (Optional)
|
|
141
|
+
- Tap the "Mark" tab to add landmarks as you encounter them
|
|
142
|
+
- Select type (mailbox, gate, shed, etc.) and name
|
|
143
|
+
- Landmarks are associated with the current camera
|
|
144
|
+
|
|
145
|
+
5. **End Training**
|
|
146
|
+
- When finished, tap "End Training"
|
|
147
|
+
- Review the statistics: cameras visited, transits recorded, landmarks marked
|
|
148
|
+
|
|
149
|
+
6. **Apply Results**
|
|
150
|
+
- Tap "Apply Results" to generate your topology
|
|
151
|
+
- The system creates camera connections with learned transit times
|
|
152
|
+
- Open the Topology Editor to fine-tune if needed
|
|
153
|
+
|
|
154
|
+
### Training Tips
|
|
155
|
+
|
|
156
|
+
- **Walk naturally** - Don't rush between cameras, walk at your normal pace
|
|
157
|
+
- **Hit every camera** - Try to be detected by each camera at least once
|
|
158
|
+
- **Create multiple transits** - Walk back and forth between cameras to improve accuracy
|
|
159
|
+
- **Mark key landmarks** - Mailbox, gates, driveway end, etc. help with contextual alerts
|
|
160
|
+
- **Re-train anytime** - Run training again to improve accuracy or add new cameras
|
|
161
|
+
|
|
162
|
+
### Mobile Access
|
|
163
|
+
|
|
164
|
+
Training Mode is designed to be used on your phone while walking. Access via:
|
|
165
|
+
```
|
|
166
|
+
https://[your-scrypted-server]/endpoint/@blueharford/scrypted-spatial-awareness/ui/training
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Setup (Manual)
|
|
100
170
|
|
|
101
171
|
1. **Configure Topology**:
|
|
102
172
|
- Open the plugin settings
|
|
@@ -233,13 +303,25 @@ The plugin exposes a REST API via Scrypted's HTTP handler:
|
|
|
233
303
|
| `/api/landmark-templates` | GET | Get landmark templates for quick setup |
|
|
234
304
|
| `/api/infer-relationships` | GET | Get auto-inferred spatial relationships |
|
|
235
305
|
|
|
236
|
-
### Connection Suggestion Endpoints
|
|
306
|
+
### Connection Suggestion Endpoints
|
|
237
307
|
| Endpoint | Method | Description |
|
|
238
308
|
|----------|--------|-------------|
|
|
239
309
|
| `/api/connection-suggestions` | GET | Get suggested camera connections |
|
|
240
310
|
| `/api/connection-suggestions/{id}/accept` | POST | Accept a connection suggestion |
|
|
241
311
|
| `/api/connection-suggestions/{id}/reject` | POST | Reject a connection suggestion |
|
|
242
312
|
|
|
313
|
+
### Training Mode Endpoints (NEW in v0.4.0)
|
|
314
|
+
| Endpoint | Method | Description |
|
|
315
|
+
|----------|--------|-------------|
|
|
316
|
+
| `/api/training/start` | POST | Start a new training session |
|
|
317
|
+
| `/api/training/pause` | POST | Pause the current training session |
|
|
318
|
+
| `/api/training/resume` | POST | Resume a paused training session |
|
|
319
|
+
| `/api/training/end` | POST | End the training session and get results |
|
|
320
|
+
| `/api/training/status` | GET | Get current training status and stats |
|
|
321
|
+
| `/api/training/landmark` | POST | Mark a landmark during training |
|
|
322
|
+
| `/api/training/apply` | POST | Apply training results to topology |
|
|
323
|
+
| `/ui/training` | GET | Mobile-optimized training UI |
|
|
324
|
+
|
|
243
325
|
## MQTT Topics
|
|
244
326
|
|
|
245
327
|
When MQTT is enabled, the plugin publishes to:
|
|
@@ -288,6 +370,15 @@ Without LLM:
|
|
|
288
370
|
|
|
289
371
|
## Changelog
|
|
290
372
|
|
|
373
|
+
### v0.4.0
|
|
374
|
+
- **Training Mode**: Guided walkthrough to train the system by walking your property
|
|
375
|
+
- **Mobile-Optimized Training UI**: Phone-friendly interface for training while walking
|
|
376
|
+
- **Auto Camera Detection**: System automatically detects you as you walk between cameras
|
|
377
|
+
- **Transit Time Learning**: Records actual transit times during training
|
|
378
|
+
- **Camera Overlap Detection**: Identifies where multiple cameras see the same area
|
|
379
|
+
- **Landmark Marking**: Mark landmarks (mailbox, gate, etc.) during training sessions
|
|
380
|
+
- **One-Click Topology Generation**: Apply training results to create complete topology
|
|
381
|
+
|
|
291
382
|
### v0.3.0
|
|
292
383
|
- **Live Tracking Overlay**: View tracked objects in real-time on the floor plan
|
|
293
384
|
- **Journey Visualization**: Click any tracked object to see their complete path
|