@trillboards/edge-sdk 0.2.218 → 0.2.220
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/deploy/windows/ci/test-detector-looks-field.ps1 +282 -0
- package/dist/CloudSensingManager.d.ts +10 -0
- package/dist/CloudSensingManager.d.ts.map +1 -1
- package/dist/CloudSensingManager.js +48 -4
- package/dist/CloudSensingManager.js.map +1 -1
- package/dist/DetectorFieldProducer.d.ts +11 -0
- package/dist/DetectorFieldProducer.d.ts.map +1 -1
- package/dist/DetectorFieldProducer.js +22 -10
- package/dist/DetectorFieldProducer.js.map +1 -1
- package/dist/EdgeAgent.js +1 -1
- package/dist/PhoneHeldInHand.d.ts +20 -1
- package/dist/PhoneHeldInHand.d.ts.map +1 -1
- package/dist/PhoneHeldInHand.js +10 -7
- package/dist/PhoneHeldInHand.js.map +1 -1
- package/dist/ReviewModelUse.d.ts.map +1 -1
- package/dist/ReviewModelUse.js +37 -9
- package/dist/ReviewModelUse.js.map +1 -1
- package/dist/ScopedVlmReview.d.ts +12 -0
- package/dist/ScopedVlmReview.d.ts.map +1 -1
- package/dist/ScopedVlmReview.js +32 -1
- package/dist/ScopedVlmReview.js.map +1 -1
- package/dist/SensingProfileClient.d.ts.map +1 -1
- package/dist/SensingProfileClient.js +2 -1
- package/dist/SensingProfileClient.js.map +1 -1
- package/dist/SharedFrameDetection.d.ts +52 -0
- package/dist/SharedFrameDetection.d.ts.map +1 -0
- package/dist/SharedFrameDetection.js +73 -0
- package/dist/SharedFrameDetection.js.map +1 -0
- package/dist/continuousReview.d.ts +4 -0
- package/dist/continuousReview.d.ts.map +1 -1
- package/dist/continuousReview.js.map +1 -1
- package/dist/diagnose.d.ts +1 -1
- package/dist/diagnose.js +1 -1
- package/dist/localSensing.d.ts +9 -0
- package/dist/localSensing.d.ts.map +1 -1
- package/dist/localSensing.js +51 -3
- package/dist/localSensing.js.map +1 -1
- package/dist/sensingRunMode.d.ts.map +1 -1
- package/dist/sensingRunMode.js +8 -4
- package/dist/sensingRunMode.js.map +1 -1
- package/package.json +2 -2
- package/retained/__tests__/runtime.test.cjs +9 -1
- package/retained/manager.cjs +21 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trillboards/edge-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.220",
|
|
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",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"optionalDependencies": {
|
|
31
31
|
"@trillboards/edge-platform-linux": "^0.2.0",
|
|
32
|
-
"@trillboards/edge-platform-rtsp": "^0.2.
|
|
32
|
+
"@trillboards/edge-platform-rtsp": "^0.2.17",
|
|
33
33
|
"@trillboards/edge-platform-windows": "^0.2.0"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
@@ -244,7 +244,8 @@ test('real website factory retains the captured contract and builds one/two slot
|
|
|
244
244
|
let starts = 0, apiChecks = 0;
|
|
245
245
|
const fieldContext = context();
|
|
246
246
|
try {
|
|
247
|
-
|
|
247
|
+
const loopDeps = [];
|
|
248
|
+
require.cache[modules[0].key].exports = { buildLocalSensingLoops: (config, deps) => (loopDeps.push(deps), config.cameras).map(feed => ({ name: feed.name,
|
|
248
249
|
client: { prepareReview: async () => {}, captureReviewContext: () => clone(fieldContext),
|
|
249
250
|
getEndpoint: () => 'https://example.invalid/v2/earner/audience-analyze',
|
|
250
251
|
localProvider: { analyze: () => { throw Error('No model call allowed'); } }, producerOptions: {}, producerInjected: false } })) };
|
|
@@ -268,6 +269,11 @@ test('real website factory retains the captured contract and builds one/two slot
|
|
|
268
269
|
maxCapturesPerCamera: 100, maxBytesPerCamera: 100000 };
|
|
269
270
|
const website = await createWebsiteManager(automatic, path.join(directory, 'website-managed'));
|
|
270
271
|
assert.equal(website.manager.options.maxConcurrentAnalyses, 1);
|
|
272
|
+
// Website detector looks pair across cameras; explicit-rule pilots stay one at a time.
|
|
273
|
+
assert.equal(website.manager.options.candidateBuffer.continuousReview.parallelDetectorReview, true);
|
|
274
|
+
// A paired call waits for the other look's inference (~0.9 s each on the Texas CPU):
|
|
275
|
+
// the producer gets the 5 s bound every other detector call of the look has.
|
|
276
|
+
assert.deepEqual(loopDeps.at(-1).detectorFieldProducerOptions, { timeoutMs: 5000, deadlineMs: 5000 });
|
|
271
277
|
for (const client of website.clients) {
|
|
272
278
|
// An API that serves no live-alert bound leaves the connector's review window in force.
|
|
273
279
|
assert.equal(client.getReviewScheduleStats().freshnessMs, 150000);
|
|
@@ -282,6 +288,8 @@ test('real website factory retains the captured contract and builds one/two slot
|
|
|
282
288
|
const selected = clone(config); if (pipeline) selected.pilot.crossCameraPipelining = true;
|
|
283
289
|
const runtime = await createWebsiteManager(selected, path.join(directory, pipeline ? 'pipelined' : 'serial'));
|
|
284
290
|
assert.equal(runtime.manager.options.maxConcurrentAnalyses, pipeline ? 2 : 1);
|
|
291
|
+
assert.equal(runtime.manager.options.candidateBuffer.continuousReview.parallelDetectorReview, undefined);
|
|
292
|
+
assert.equal(loopDeps.at(-1).detectorFieldProducerOptions, undefined);
|
|
285
293
|
assert.equal(!!runtime.stageScheduler, pipeline);
|
|
286
294
|
for (const client of runtime.clients) {
|
|
287
295
|
const actual = client.captureReviewContext();
|
package/retained/manager.cjs
CHANGED
|
@@ -26,6 +26,9 @@ function assertSelectedModelsPrepared(models, actorPolicy, requiresDetector) {
|
|
|
26
26
|
|
|
27
27
|
// The normal connector's website entry point. Capability, strict profile and
|
|
28
28
|
// artifact identity still pass before capture; this is not a second installer.
|
|
29
|
+
/** LocalDetectorClient's own per-call default, which every other detector call of a look waits. */
|
|
30
|
+
const PAIRED_DETECTOR_CALL_MS = 5000;
|
|
31
|
+
|
|
29
32
|
async function createWebsiteManager(input, stateDirectory, deps = {}) {
|
|
30
33
|
const config = JSON.parse(JSON.stringify(input));
|
|
31
34
|
const { buildLocalSensingLoops } = take('localSensing');
|
|
@@ -72,7 +75,24 @@ async function createWebsiteManager(input, stateDirectory, deps = {}) {
|
|
|
72
75
|
&& options.scopedVlmReview !== true && options.detectorCounts !== true && config.pilot.requiresDetector === true,
|
|
73
76
|
'Stage pipeline is an isolated two-feed mixed-review experiment');
|
|
74
77
|
const stages = pipeline ? new (require('./ModelStageScheduler.cjs').ModelStageScheduler)() : null;
|
|
75
|
-
|
|
78
|
+
// Website looks the box decides without Gemma (ReviewModelUse 'detector') run two at a
|
|
79
|
+
// time across cameras; a look that might ask Gemma still has the box to itself.
|
|
80
|
+
// Same truthiness CloudSensingManager validates with, so a setting it refuses never pairs.
|
|
81
|
+
if (websiteManaged && !pipeline && !options.parallelModelReview && !options.urgentTriage) {
|
|
82
|
+
options.parallelDetectorReview = true;
|
|
83
|
+
}
|
|
84
|
+
// A paired look's detector call waits for the other look's inference: the service runs one
|
|
85
|
+
// inference at a time under its session lock. On the Texas i7-7700 one RF-DETR call is ~0.9 s
|
|
86
|
+
// (camera 22, person fields only: look p50 925 ms, p99 1,196 ms, 2026-11-08), so a paired
|
|
87
|
+
// call takes ~1.8 s, past the producer's 1 s per-call timeout and 1.5 s frame budget, which
|
|
88
|
+
// were sized for a 63 ms GPU detector. Every other detector call of the same look already
|
|
89
|
+
// waits LocalDetectorClient's 5 s; the producer gets that bound too, or a paired look of a
|
|
90
|
+
// person camera would time out and be retained instead of answered.
|
|
91
|
+
const producerBound = options.parallelDetectorReview === true ? { detectorFieldProducerOptions: {
|
|
92
|
+
...(deps.detectorFieldProducerOptions ?? {}),
|
|
93
|
+
timeoutMs: Math.max(PAIRED_DETECTOR_CALL_MS, deps.detectorFieldProducerOptions?.timeoutMs ?? 0),
|
|
94
|
+
deadlineMs: Math.max(PAIRED_DETECTOR_CALL_MS, deps.detectorFieldProducerOptions?.deadlineMs ?? 0) } } : {};
|
|
95
|
+
const loops = buildLocalSensingLoops(config, { ...deps, ...producerBound, websiteManagedProfiles: websiteManaged,
|
|
76
96
|
// The paired API takes a review without its photo (capabilities `evidenceImage.optional`).
|
|
77
97
|
imagelessReview: feed => capabilities.get(feed.name)?.imagelessReview === true,
|
|
78
98
|
profileClientFactory: deps.profileClientFactory ?? (feed => require('./pilot-profile-client.cjs').createPilotProfileClient(
|