@trillboards/edge-sdk 0.1.0 → 0.2.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/LICENSE +21 -0
- package/README.md +113 -0
- package/deploy/docker/package.json +3 -3
- package/package.json +26 -11
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 Trillboards, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# @trillboards/edge-sdk
|
|
2
|
+
|
|
3
|
+
> **Turn any screen into an AI-powered DOOH advertising endpoint.** Edge AI audience sensing, ad delivery, federated learning, and cloud inference in one package. Linux and Windows.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @trillboards/edge-sdk
|
|
9
|
+
npx trillboards-edge download-models
|
|
10
|
+
npx trillboards-edge start --config trillboards.config.json
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## What This Does
|
|
14
|
+
|
|
15
|
+
The Edge SDK runs on digital signage hardware (kiosks, vending machines, billboards, CTV devices) and provides:
|
|
16
|
+
|
|
17
|
+
- **Audience sensing** — on-device face detection, gaze tracking, emotion analysis, foot traffic estimation via ONNX models (no cloud dependency)
|
|
18
|
+
- **Ad delivery** — Chromium browser lifecycle, display management, VAST/VPAID ad rendering
|
|
19
|
+
- **Federated learning** — privacy-preserving on-device model training with sparse gradient uploads
|
|
20
|
+
- **Cloud inference** — Gemini Vision scene analysis, content moderation, contextual targeting
|
|
21
|
+
- **Device management** — heartbeat, health monitoring, auto-recovery, signal buffering for offline resilience
|
|
22
|
+
|
|
23
|
+
All audience data stays on-device. Only aggregated, anonymized metrics are transmitted.
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
Create `trillboards.config.json`:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"apiBaseUrl": "https://api.trillboards.com",
|
|
32
|
+
"deviceToken": "your-device-token",
|
|
33
|
+
"camera": { "enabled": true, "width": 640, "height": 480, "fps": 10 },
|
|
34
|
+
"audio": { "enabled": true },
|
|
35
|
+
"models": { "dir": "./models", "executionProvider": "cpu" },
|
|
36
|
+
"kiosk": { "enabled": true, "url": "https://screen.trillboards.com" },
|
|
37
|
+
"cloud": { "enabled": false },
|
|
38
|
+
"federated": { "enabled": true },
|
|
39
|
+
"logLevel": "info"
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Programmatic Usage
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import { EdgeAgent, loadConfig } from '@trillboards/edge-sdk';
|
|
47
|
+
|
|
48
|
+
const config = loadConfig('trillboards.config.json');
|
|
49
|
+
const agent = new EdgeAgent(config);
|
|
50
|
+
|
|
51
|
+
agent.on('started', ({ fingerprint, tier }) => {
|
|
52
|
+
console.log(`Device ${fingerprint} running at TIER_${tier}`);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
await agent.start();
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## CLI Commands
|
|
59
|
+
|
|
60
|
+
| Command | Description |
|
|
61
|
+
|---------|-------------|
|
|
62
|
+
| `trillboards-edge start [--config path]` | Start the edge agent |
|
|
63
|
+
| `trillboards-edge download-models [--dir path]` | Download ONNX models (BlazeFace, YAMNet) |
|
|
64
|
+
| `trillboards-edge version` | Print SDK version |
|
|
65
|
+
|
|
66
|
+
## Capability Tiers
|
|
67
|
+
|
|
68
|
+
The SDK auto-detects device capabilities and adjusts inference accordingly:
|
|
69
|
+
|
|
70
|
+
| Tier | RAM | NPU | Models | FPS |
|
|
71
|
+
|------|-----|-----|--------|-----|
|
|
72
|
+
| TIER_1 | < 2 GB | No | Face only | 2 |
|
|
73
|
+
| TIER_2 | 2-4 GB | No | Face + Audio | 5 |
|
|
74
|
+
| TIER_3 | 4-8 GB | Optional | All models | 10 |
|
|
75
|
+
| TIER_4 | 8+ GB | Yes | All + high-res | 15+ |
|
|
76
|
+
|
|
77
|
+
## Execution Providers
|
|
78
|
+
|
|
79
|
+
- `cpu` — works everywhere (default)
|
|
80
|
+
- `openvino` — Intel integrated GPU (2-3x faster)
|
|
81
|
+
- `directml` — Windows GPU acceleration
|
|
82
|
+
- `cuda` — NVIDIA GPU
|
|
83
|
+
|
|
84
|
+
## Sub-Packages
|
|
85
|
+
|
|
86
|
+
This is the umbrella package. For fine-grained control, install sub-packages individually:
|
|
87
|
+
|
|
88
|
+
| Package | Purpose |
|
|
89
|
+
|---------|---------|
|
|
90
|
+
| [@trillboards/edge-core](https://www.npmjs.com/package/@trillboards/edge-core) | Device identity, Socket.io, config, signal buffer, health monitoring |
|
|
91
|
+
| [@trillboards/edge-sensing](https://www.npmjs.com/package/@trillboards/edge-sensing) | ONNX face detection, audio classification, audience metrics |
|
|
92
|
+
| [@trillboards/edge-ads](https://www.npmjs.com/package/@trillboards/edge-ads) | Chromium browser lifecycle, display management, ad delivery |
|
|
93
|
+
| [@trillboards/edge-federated](https://www.npmjs.com/package/@trillboards/edge-federated) | On-device federated learning, sparse gradient upload |
|
|
94
|
+
| [@trillboards/edge-cloud](https://www.npmjs.com/package/@trillboards/edge-cloud) | Gemini Vision scene analysis, contextual targeting |
|
|
95
|
+
| [@trillboards/edge-platform-linux](https://www.npmjs.com/package/@trillboards/edge-platform-linux) | V4L2 camera, PulseAudio, systemd, kiosk mode |
|
|
96
|
+
| [@trillboards/edge-platform-windows](https://www.npmjs.com/package/@trillboards/edge-platform-windows) | DirectShow, RTSP IP cameras, WASAPI audio |
|
|
97
|
+
|
|
98
|
+
## Platform Support
|
|
99
|
+
|
|
100
|
+
- **Linux** — Ubuntu 20.04+, Debian 11+, Raspberry Pi OS (ARM64)
|
|
101
|
+
- **Windows** — Windows 10/11 (x64)
|
|
102
|
+
|
|
103
|
+
## Get a Device Token
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
npx @trillboards/ads-sdk init
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Or register via the [Trillboards API](https://api.trillboards.com/developer).
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
MIT
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trillboards-edge-docker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@trillboards/edge-sdk": "0.
|
|
7
|
-
"@trillboards/edge-platform-linux": "0.
|
|
6
|
+
"@trillboards/edge-sdk": "^0.2.0",
|
|
7
|
+
"@trillboards/edge-platform-linux": "^0.2.0"
|
|
8
8
|
}
|
|
9
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trillboards/edge-sdk",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Composable cross-platform Edge AI SDK for audience sensing on DOOH/CTV devices",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,21 +15,22 @@
|
|
|
15
15
|
"prepublishOnly": "npm run build"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@trillboards/edge-core": "0.
|
|
19
|
-
"@trillboards/edge-sensing": "0.
|
|
20
|
-
"@trillboards/edge-federated": "0.
|
|
21
|
-
"@trillboards/edge-ads": "0.
|
|
22
|
-
"@trillboards/edge-cloud": "0.
|
|
18
|
+
"@trillboards/edge-core": "^0.2.0",
|
|
19
|
+
"@trillboards/edge-sensing": "^0.2.0",
|
|
20
|
+
"@trillboards/edge-federated": "^0.2.0",
|
|
21
|
+
"@trillboards/edge-ads": "^0.2.0",
|
|
22
|
+
"@trillboards/edge-cloud": "^0.2.0"
|
|
23
23
|
},
|
|
24
24
|
"optionalDependencies": {
|
|
25
|
-
"@trillboards/edge-platform-linux": "0.
|
|
26
|
-
"@trillboards/edge-platform-windows": "0.
|
|
25
|
+
"@trillboards/edge-platform-linux": "^0.2.0",
|
|
26
|
+
"@trillboards/edge-platform-windows": "^0.2.0"
|
|
27
27
|
},
|
|
28
|
-
"files": ["dist", "configs", "deploy"],
|
|
28
|
+
"files": ["dist", "configs", "deploy", "LICENSE", "README.md"],
|
|
29
29
|
"engines": {
|
|
30
30
|
"node": ">=18.0.0"
|
|
31
31
|
},
|
|
32
|
-
"
|
|
32
|
+
"author": "Trillboards <engineering@trillboards.com>",
|
|
33
|
+
"license": "MIT",
|
|
33
34
|
"publishConfig": {
|
|
34
35
|
"access": "public"
|
|
35
36
|
},
|
|
@@ -38,7 +39,21 @@
|
|
|
38
39
|
"url": "https://github.com/trillboards/packages.git",
|
|
39
40
|
"directory": "trillboards-edge-sdk/packages/edge-sdk"
|
|
40
41
|
},
|
|
41
|
-
"keywords": [
|
|
42
|
+
"keywords": [
|
|
43
|
+
"edge-ai",
|
|
44
|
+
"dooh",
|
|
45
|
+
"audience-sensing",
|
|
46
|
+
"onnx",
|
|
47
|
+
"ctv",
|
|
48
|
+
"digital-signage",
|
|
49
|
+
"computer-vision",
|
|
50
|
+
"face-detection",
|
|
51
|
+
"federated-learning",
|
|
52
|
+
"mcp",
|
|
53
|
+
"model-context-protocol",
|
|
54
|
+
"smart-display",
|
|
55
|
+
"attention-measurement"
|
|
56
|
+
],
|
|
42
57
|
"devDependencies": {
|
|
43
58
|
"@types/jest": "^29.5.0",
|
|
44
59
|
"@types/node": "^20.0.0",
|