@camstack/addon-post-analysis 1.2.204 → 1.2.205
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.
|
@@ -46115,6 +46115,8 @@ function detailsCarryEnrichment(details) {
|
|
|
46115
46115
|
}
|
|
46116
46116
|
/** Throttle for the per-device "detail call failed" warn — one line / minute. */
|
|
46117
46117
|
var FAIL_WARN_THROTTLE_MS = 6e4;
|
|
46118
|
+
/** How often a camera reports the coasted frames its detail plane ignored (D397). */
|
|
46119
|
+
var COASTED_REPORT_INTERVAL_MS = 6e4;
|
|
46118
46120
|
var TrackDetailDispatcher = class {
|
|
46119
46121
|
deps;
|
|
46120
46122
|
devices = /* @__PURE__ */ new Map();
|
|
@@ -46148,6 +46150,11 @@ var TrackDetailDispatcher = class {
|
|
|
46148
46150
|
* already has state is never reset. */
|
|
46149
46151
|
onFrame(deviceId, trackId, announce, frame, nowMs) {
|
|
46150
46152
|
if (this.disposed) return;
|
|
46153
|
+
if (frame.matchedThisFrame === false) {
|
|
46154
|
+
const known = this.devices.get(deviceId);
|
|
46155
|
+
if (known) known.coastedFramesIgnored += 1;
|
|
46156
|
+
return;
|
|
46157
|
+
}
|
|
46151
46158
|
const dev = this.devices.get(deviceId);
|
|
46152
46159
|
if (!dev || !dev.tracks.has(trackId)) {
|
|
46153
46160
|
if (announce.length > 0) this.onTrackStarted(deviceId, trackId, frame.className, announce, frame, nowMs);
|
|
@@ -46158,6 +46165,16 @@ var TrackDetailDispatcher = class {
|
|
|
46158
46165
|
const requests = dev.scheduler.onCandidateImproved(trackId, nowMs);
|
|
46159
46166
|
this.enqueue(deviceId, dev, requests);
|
|
46160
46167
|
}
|
|
46168
|
+
/**
|
|
46169
|
+
* Coasted frames ignored for one device since this dispatcher started.
|
|
46170
|
+
*
|
|
46171
|
+
* Exposed rather than logged from here: the dispatcher has no cadence of its
|
|
46172
|
+
* own to report on, and the addon already emits a per-camera line where this
|
|
46173
|
+
* belongs beside the numbers it explains.
|
|
46174
|
+
*/
|
|
46175
|
+
coastedFramesIgnored(deviceId) {
|
|
46176
|
+
return this.devices.get(deviceId)?.coastedFramesIgnored ?? 0;
|
|
46177
|
+
}
|
|
46161
46178
|
/** A track ended (durable TTL expiry): drop its scheduler + frame state. Any
|
|
46162
46179
|
* queued request for it is discarded at dequeue. */
|
|
46163
46180
|
onTrackEnded(deviceId, trackId) {
|
|
@@ -46186,6 +46203,11 @@ var TrackDetailDispatcher = class {
|
|
|
46186
46203
|
tracks: /* @__PURE__ */ new Map(),
|
|
46187
46204
|
candidateBest: new BestDetectionTracker(CANDIDATE_IMPROVE_POLICY),
|
|
46188
46205
|
queue: [],
|
|
46206
|
+
coastedFramesIgnored: 0,
|
|
46207
|
+
coastedReportedAt: {
|
|
46208
|
+
count: 0,
|
|
46209
|
+
at: Date.now()
|
|
46210
|
+
},
|
|
46189
46211
|
inFlight: 0,
|
|
46190
46212
|
timer: null,
|
|
46191
46213
|
lastFailWarnAt: 0,
|
|
@@ -46209,9 +46231,42 @@ var TrackDetailDispatcher = class {
|
|
|
46209
46231
|
}
|
|
46210
46232
|
tick(deviceId, dev) {
|
|
46211
46233
|
if (this.disposed) return;
|
|
46212
|
-
const
|
|
46234
|
+
const now = Date.now();
|
|
46235
|
+
this.reportCoasted(deviceId, dev, now);
|
|
46236
|
+
const requests = dev.scheduler.tick(now);
|
|
46213
46237
|
this.enqueue(deviceId, dev, requests);
|
|
46214
46238
|
}
|
|
46239
|
+
/**
|
|
46240
|
+
* Say how many coasted frames this camera's detail plane ignored (D397),
|
|
46241
|
+
* once per {@link COASTED_REPORT_INTERVAL_MS}, and only when there were any.
|
|
46242
|
+
*
|
|
46243
|
+
* Per camera and per interval rather than per frame: a coasting track offers
|
|
46244
|
+
* one of these several times a second, and the question this answers is
|
|
46245
|
+
* always "why is 617 worse than 615?".
|
|
46246
|
+
*/
|
|
46247
|
+
reportCoasted(deviceId, dev, now) {
|
|
46248
|
+
const ignored = dev.coastedFramesIgnored - dev.coastedReportedAt.count;
|
|
46249
|
+
if (ignored <= 0) {
|
|
46250
|
+
dev.coastedReportedAt = {
|
|
46251
|
+
count: dev.coastedFramesIgnored,
|
|
46252
|
+
at: now
|
|
46253
|
+
};
|
|
46254
|
+
return;
|
|
46255
|
+
}
|
|
46256
|
+
if (now - dev.coastedReportedAt.at < COASTED_REPORT_INTERVAL_MS) return;
|
|
46257
|
+
this.deps.logger.info("detail dispatch: coasted frames ignored — the subject was not observed in them", {
|
|
46258
|
+
tags: { deviceId },
|
|
46259
|
+
meta: {
|
|
46260
|
+
ignored,
|
|
46261
|
+
windowMs: now - dev.coastedReportedAt.at,
|
|
46262
|
+
liveTracks: dev.tracks.size
|
|
46263
|
+
}
|
|
46264
|
+
});
|
|
46265
|
+
dev.coastedReportedAt = {
|
|
46266
|
+
count: dev.coastedFramesIgnored,
|
|
46267
|
+
at: now
|
|
46268
|
+
};
|
|
46269
|
+
}
|
|
46215
46270
|
enqueue(deviceId, dev, requests) {
|
|
46216
46271
|
if (requests.length === 0) return;
|
|
46217
46272
|
for (const r of requests) dev.queue.push(r);
|
|
@@ -71666,6 +71721,7 @@ var PipelineAnalyticsAddon = class PipelineAnalyticsAddon extends require_dist.B
|
|
|
71666
71721
|
className: t.className,
|
|
71667
71722
|
confidence: t.confidence,
|
|
71668
71723
|
timestamp: result.timestamp,
|
|
71724
|
+
...t.matchedThisFrame !== void 0 ? { matchedThisFrame: t.matchedThisFrame } : {},
|
|
71669
71725
|
...frameHandle !== void 0 ? {
|
|
71670
71726
|
frameHandle,
|
|
71671
71727
|
nodeId: frameHandle.nodeId
|
|
@@ -46041,6 +46041,8 @@ function detailsCarryEnrichment(details) {
|
|
|
46041
46041
|
}
|
|
46042
46042
|
/** Throttle for the per-device "detail call failed" warn — one line / minute. */
|
|
46043
46043
|
var FAIL_WARN_THROTTLE_MS = 6e4;
|
|
46044
|
+
/** How often a camera reports the coasted frames its detail plane ignored (D397). */
|
|
46045
|
+
var COASTED_REPORT_INTERVAL_MS = 6e4;
|
|
46044
46046
|
var TrackDetailDispatcher = class {
|
|
46045
46047
|
deps;
|
|
46046
46048
|
devices = /* @__PURE__ */ new Map();
|
|
@@ -46074,6 +46076,11 @@ var TrackDetailDispatcher = class {
|
|
|
46074
46076
|
* already has state is never reset. */
|
|
46075
46077
|
onFrame(deviceId, trackId, announce, frame, nowMs) {
|
|
46076
46078
|
if (this.disposed) return;
|
|
46079
|
+
if (frame.matchedThisFrame === false) {
|
|
46080
|
+
const known = this.devices.get(deviceId);
|
|
46081
|
+
if (known) known.coastedFramesIgnored += 1;
|
|
46082
|
+
return;
|
|
46083
|
+
}
|
|
46077
46084
|
const dev = this.devices.get(deviceId);
|
|
46078
46085
|
if (!dev || !dev.tracks.has(trackId)) {
|
|
46079
46086
|
if (announce.length > 0) this.onTrackStarted(deviceId, trackId, frame.className, announce, frame, nowMs);
|
|
@@ -46084,6 +46091,16 @@ var TrackDetailDispatcher = class {
|
|
|
46084
46091
|
const requests = dev.scheduler.onCandidateImproved(trackId, nowMs);
|
|
46085
46092
|
this.enqueue(deviceId, dev, requests);
|
|
46086
46093
|
}
|
|
46094
|
+
/**
|
|
46095
|
+
* Coasted frames ignored for one device since this dispatcher started.
|
|
46096
|
+
*
|
|
46097
|
+
* Exposed rather than logged from here: the dispatcher has no cadence of its
|
|
46098
|
+
* own to report on, and the addon already emits a per-camera line where this
|
|
46099
|
+
* belongs beside the numbers it explains.
|
|
46100
|
+
*/
|
|
46101
|
+
coastedFramesIgnored(deviceId) {
|
|
46102
|
+
return this.devices.get(deviceId)?.coastedFramesIgnored ?? 0;
|
|
46103
|
+
}
|
|
46087
46104
|
/** A track ended (durable TTL expiry): drop its scheduler + frame state. Any
|
|
46088
46105
|
* queued request for it is discarded at dequeue. */
|
|
46089
46106
|
onTrackEnded(deviceId, trackId) {
|
|
@@ -46112,6 +46129,11 @@ var TrackDetailDispatcher = class {
|
|
|
46112
46129
|
tracks: /* @__PURE__ */ new Map(),
|
|
46113
46130
|
candidateBest: new BestDetectionTracker(CANDIDATE_IMPROVE_POLICY),
|
|
46114
46131
|
queue: [],
|
|
46132
|
+
coastedFramesIgnored: 0,
|
|
46133
|
+
coastedReportedAt: {
|
|
46134
|
+
count: 0,
|
|
46135
|
+
at: Date.now()
|
|
46136
|
+
},
|
|
46115
46137
|
inFlight: 0,
|
|
46116
46138
|
timer: null,
|
|
46117
46139
|
lastFailWarnAt: 0,
|
|
@@ -46135,9 +46157,42 @@ var TrackDetailDispatcher = class {
|
|
|
46135
46157
|
}
|
|
46136
46158
|
tick(deviceId, dev) {
|
|
46137
46159
|
if (this.disposed) return;
|
|
46138
|
-
const
|
|
46160
|
+
const now = Date.now();
|
|
46161
|
+
this.reportCoasted(deviceId, dev, now);
|
|
46162
|
+
const requests = dev.scheduler.tick(now);
|
|
46139
46163
|
this.enqueue(deviceId, dev, requests);
|
|
46140
46164
|
}
|
|
46165
|
+
/**
|
|
46166
|
+
* Say how many coasted frames this camera's detail plane ignored (D397),
|
|
46167
|
+
* once per {@link COASTED_REPORT_INTERVAL_MS}, and only when there were any.
|
|
46168
|
+
*
|
|
46169
|
+
* Per camera and per interval rather than per frame: a coasting track offers
|
|
46170
|
+
* one of these several times a second, and the question this answers is
|
|
46171
|
+
* always "why is 617 worse than 615?".
|
|
46172
|
+
*/
|
|
46173
|
+
reportCoasted(deviceId, dev, now) {
|
|
46174
|
+
const ignored = dev.coastedFramesIgnored - dev.coastedReportedAt.count;
|
|
46175
|
+
if (ignored <= 0) {
|
|
46176
|
+
dev.coastedReportedAt = {
|
|
46177
|
+
count: dev.coastedFramesIgnored,
|
|
46178
|
+
at: now
|
|
46179
|
+
};
|
|
46180
|
+
return;
|
|
46181
|
+
}
|
|
46182
|
+
if (now - dev.coastedReportedAt.at < COASTED_REPORT_INTERVAL_MS) return;
|
|
46183
|
+
this.deps.logger.info("detail dispatch: coasted frames ignored — the subject was not observed in them", {
|
|
46184
|
+
tags: { deviceId },
|
|
46185
|
+
meta: {
|
|
46186
|
+
ignored,
|
|
46187
|
+
windowMs: now - dev.coastedReportedAt.at,
|
|
46188
|
+
liveTracks: dev.tracks.size
|
|
46189
|
+
}
|
|
46190
|
+
});
|
|
46191
|
+
dev.coastedReportedAt = {
|
|
46192
|
+
count: dev.coastedFramesIgnored,
|
|
46193
|
+
at: now
|
|
46194
|
+
};
|
|
46195
|
+
}
|
|
46141
46196
|
enqueue(deviceId, dev, requests) {
|
|
46142
46197
|
if (requests.length === 0) return;
|
|
46143
46198
|
for (const r of requests) dev.queue.push(r);
|
|
@@ -71592,6 +71647,7 @@ var PipelineAnalyticsAddon = class PipelineAnalyticsAddon extends BaseAddon {
|
|
|
71592
71647
|
className: t.className,
|
|
71593
71648
|
confidence: t.confidence,
|
|
71594
71649
|
timestamp: result.timestamp,
|
|
71650
|
+
...t.matchedThisFrame !== void 0 ? { matchedThisFrame: t.matchedThisFrame } : {},
|
|
71595
71651
|
...frameHandle !== void 0 ? {
|
|
71596
71652
|
frameHandle,
|
|
71597
71653
|
nodeId: frameHandle.nodeId
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-post-analysis",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.205",
|
|
4
4
|
"description": "Post-Analysis bundle — enrichment, embedding-encoder, pipeline-analytics. Multi-entry npm package shipping addons that consume pipeline output.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|