@camstack/addon-post-analysis 1.2.44 → 1.2.45
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.
|
@@ -20621,16 +20621,25 @@ var ObjectEmbeddingStore = class {
|
|
|
20621
20621
|
* Upsert the best-confidence embedding for a track. At most ONE row per
|
|
20622
20622
|
* track: a write only replaces the stored row when its confidence is
|
|
20623
20623
|
* strictly higher, keeping the track's best crop over its lifetime.
|
|
20624
|
+
*
|
|
20625
|
+
* `force` BYPASSES that gate — it does not try to out-score it. A rebuild
|
|
20626
|
+
* first attempted to win by writing `confidence: Infinity`, which worked
|
|
20627
|
+
* exactly once: the stored row then held Infinity, `Infinity <= Infinity`
|
|
20628
|
+
* short-circuited, and every later pass silently wrote nothing while
|
|
20629
|
+
* reporting hundreds rebuilt. Observed live — 214 "rebuilt" moved the index
|
|
20630
|
+
* by 4 rows.
|
|
20624
20631
|
*/
|
|
20625
20632
|
async upsertIfBetter(input) {
|
|
20626
20633
|
if (input.embedding.length === 0) return;
|
|
20627
20634
|
if (!await this.ensureIndex(input.embedding.length)) return;
|
|
20628
20635
|
try {
|
|
20629
|
-
|
|
20630
|
-
|
|
20631
|
-
|
|
20632
|
-
|
|
20633
|
-
|
|
20636
|
+
if (input.force !== true) {
|
|
20637
|
+
const stored = (await this.vectorStore.getByIds.query({
|
|
20638
|
+
index: OBJECT_CLIP_INDEX,
|
|
20639
|
+
ids: [input.trackId]
|
|
20640
|
+
})).items[0]?.metadata["confidence"];
|
|
20641
|
+
if (typeof stored === "number" && input.confidence <= stored) return;
|
|
20642
|
+
}
|
|
20634
20643
|
if ((await this.vectorStore.upsert.mutate({
|
|
20635
20644
|
index: "object-clip",
|
|
20636
20645
|
items: [{
|
|
@@ -27112,7 +27121,8 @@ var PipelineAnalyticsAddon = class extends require_dist.BaseAddon {
|
|
|
27112
27121
|
className: source.className,
|
|
27113
27122
|
embedding,
|
|
27114
27123
|
modelId,
|
|
27115
|
-
confidence:
|
|
27124
|
+
confidence: source.confidence,
|
|
27125
|
+
force: true,
|
|
27116
27126
|
...source.mediaKey !== void 0 ? { mediaKey: source.mediaKey } : {},
|
|
27117
27127
|
...source.keyFrameMediaKey !== void 0 ? { keyFrameMediaKey: source.keyFrameMediaKey } : {}
|
|
27118
27128
|
});
|
|
@@ -20615,16 +20615,25 @@ var ObjectEmbeddingStore = class {
|
|
|
20615
20615
|
* Upsert the best-confidence embedding for a track. At most ONE row per
|
|
20616
20616
|
* track: a write only replaces the stored row when its confidence is
|
|
20617
20617
|
* strictly higher, keeping the track's best crop over its lifetime.
|
|
20618
|
+
*
|
|
20619
|
+
* `force` BYPASSES that gate — it does not try to out-score it. A rebuild
|
|
20620
|
+
* first attempted to win by writing `confidence: Infinity`, which worked
|
|
20621
|
+
* exactly once: the stored row then held Infinity, `Infinity <= Infinity`
|
|
20622
|
+
* short-circuited, and every later pass silently wrote nothing while
|
|
20623
|
+
* reporting hundreds rebuilt. Observed live — 214 "rebuilt" moved the index
|
|
20624
|
+
* by 4 rows.
|
|
20618
20625
|
*/
|
|
20619
20626
|
async upsertIfBetter(input) {
|
|
20620
20627
|
if (input.embedding.length === 0) return;
|
|
20621
20628
|
if (!await this.ensureIndex(input.embedding.length)) return;
|
|
20622
20629
|
try {
|
|
20623
|
-
|
|
20624
|
-
|
|
20625
|
-
|
|
20626
|
-
|
|
20627
|
-
|
|
20630
|
+
if (input.force !== true) {
|
|
20631
|
+
const stored = (await this.vectorStore.getByIds.query({
|
|
20632
|
+
index: OBJECT_CLIP_INDEX,
|
|
20633
|
+
ids: [input.trackId]
|
|
20634
|
+
})).items[0]?.metadata["confidence"];
|
|
20635
|
+
if (typeof stored === "number" && input.confidence <= stored) return;
|
|
20636
|
+
}
|
|
20628
20637
|
if ((await this.vectorStore.upsert.mutate({
|
|
20629
20638
|
index: "object-clip",
|
|
20630
20639
|
items: [{
|
|
@@ -27106,7 +27115,8 @@ var PipelineAnalyticsAddon = class extends BaseAddon {
|
|
|
27106
27115
|
className: source.className,
|
|
27107
27116
|
embedding,
|
|
27108
27117
|
modelId,
|
|
27109
|
-
confidence:
|
|
27118
|
+
confidence: source.confidence,
|
|
27119
|
+
force: true,
|
|
27110
27120
|
...source.mediaKey !== void 0 ? { mediaKey: source.mediaKey } : {},
|
|
27111
27121
|
...source.keyFrameMediaKey !== void 0 ? { keyFrameMediaKey: source.keyFrameMediaKey } : {}
|
|
27112
27122
|
});
|
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.45",
|
|
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",
|